diff options
author | Alan Conway <aconway@apache.org> | 2007-03-21 02:08:18 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-03-21 02:08:18 +0000 |
commit | d2eb3361494710466280341c98f76c03536d2ebe (patch) | |
tree | f16ec2eacd8383e388657e54a22fc0214a0ce023 /qpid/cpp/lib/common/framing/FramingContent.h | |
parent | 732544fe86089ab86c03fcc48d5ca4c72667c275 (diff) | |
download | qpid-python-d2eb3361494710466280341c98f76c03536d2ebe.tar.gz |
Renamed cpp-0-9 to cpp
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@520706 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib/common/framing/FramingContent.h')
-rw-r--r-- | qpid/cpp/lib/common/framing/FramingContent.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/qpid/cpp/lib/common/framing/FramingContent.h b/qpid/cpp/lib/common/framing/FramingContent.h new file mode 100644 index 0000000000..696bcc7c1a --- /dev/null +++ b/qpid/cpp/lib/common/framing/FramingContent.h @@ -0,0 +1,40 @@ +#ifndef _framing_FramingContent_h +#define _framing_FramingContent_h + +#include <ostream> + +namespace qpid { +namespace framing { + +enum discriminator_types { INLINE = 0, REFERENCE = 1 }; + +/** + * A representation of the AMQP 'content' data type (used for message + * bodies) which can hold inline data or a reference. + */ +class Content +{ + uint8_t discriminator; + string value; + + void validate(); + + public: + Content(); + Content(uint8_t _discriminator, const string& _value); + ~Content(); + + void encode(Buffer& buffer) const; + void decode(Buffer& buffer); + size_t size() const; + bool isInline() const { return discriminator == INLINE; } + bool isReference() const { return discriminator == REFERENCE; } + const string& getValue() const { return value; } + + friend std::ostream& operator<<(std::ostream&, const Content&); +}; + +}} // namespace qpid::framing + + +#endif /*!_framing_FramingContent_h*/ |