added more constructors to AMQP::Envelope
This commit is contained in:
parent
31ded89de5
commit
cdcdaf79a3
|
|
@ -53,8 +53,19 @@ public:
|
|||
* @param size
|
||||
*/
|
||||
Envelope(const char *body, uint64_t size) : MetaData(), _body(body), _bodySize(size) {}
|
||||
Envelope(const std::string_view &body) : Envelope(body.data(), body.size()) {}
|
||||
Envelope(const char *body) : Envelope(body, strlen(body)) {}
|
||||
|
||||
/**
|
||||
* Constructor that preserves meta-data, but installs different body
|
||||
* @param metadata
|
||||
* @param body
|
||||
* @param size
|
||||
*/
|
||||
Envelope(const MetaData &metadata, const char *body, uint64_t size) : MetaData(metadata), _body(body), _bodySize(size) {}
|
||||
Envelope(const MetaData &metadata, const std::string_view &body) : Envelope(metadata, body.data(), body.size()) {}
|
||||
Envelope(const MetaData &metadata, const char *body) : Envelope(metadata, body, strlen(body)) {}
|
||||
|
||||
/**
|
||||
* Read envelope frmo an input-buffer
|
||||
* This method is the counterpart of the Envelope::fill() method, and is not used
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* With every published message a set of meta data is passed to. This class
|
||||
* holds all that meta data.
|
||||
*
|
||||
* @copyright 2014 - 2017 Copernica BV
|
||||
* @copyright 2014 - 2023 Copernica BV
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
@ -127,14 +127,12 @@ protected:
|
|||
ShortString _clusterID;
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Protected constructor to ensure that this class can only be constructed
|
||||
* in a derived class
|
||||
* Constructor for empty meta data. Can be useful when user-space wants to preserve all meta-data
|
||||
*/
|
||||
MetaData() {}
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Read incoming frame
|
||||
* @param frame
|
||||
|
|
|
|||
Loading…
Reference in New Issue