pulsar-client-cpp
MessageBatch.h
1 
20 #ifndef LIB_MESSAGE_BATCH_H
21 #define LIB_MESSAGE_BATCH_H
22 #include <pulsar/Message.h>
23 #include <pulsar/defines.h>
24 
25 #include <vector>
26 
27 namespace pulsar {
28 
29 class PULSAR_PUBLIC MessageBatch {
30  public:
31  MessageBatch();
32 
33  MessageBatch& withMessageId(const MessageId& messageId);
34 
35  MessageBatch& parseFrom(const std::string& payload, uint32_t batchSize);
36 
37  MessageBatch& parseFrom(const SharedBuffer& payload, uint32_t batchSize);
38 
39  const std::vector<Message>& messages();
40 
41  private:
42  typedef std::shared_ptr<MessageImpl> MessageImplPtr;
43  MessageImplPtr impl_;
44  Message batchMessage_;
45 
46  std::vector<Message> batch_;
47 };
48 } // namespace pulsar
49 #endif // LIB_MESSAGE_BATCH_H
pulsar::MessageId
Definition: MessageId.h:34
pulsar::MessageBatch
Definition: MessageBatch.h:29
pulsar::Message
Definition: Message.h:43
pulsar
Definition: Authentication.h:31