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