00001 #ifndef _framing_FramingContent_h
00002 #define _framing_FramingContent_h
00003
00004 #include <ostream>
00005
00006 namespace qpid {
00007 namespace framing {
00008
00009 enum discriminator_types { INLINE = 0, REFERENCE = 1 };
00010
00015 class Content
00016 {
00017 uint8_t discriminator;
00018 string value;
00019
00020 void validate();
00021
00022 public:
00023 Content();
00024 Content(uint8_t _discriminator, const string& _value);
00025 ~Content();
00026
00027 void encode(Buffer& buffer) const;
00028 void decode(Buffer& buffer);
00029 size_t size() const;
00030 bool isInline() const { return discriminator == INLINE; }
00031 bool isReference() const { return discriminator == REFERENCE; }
00032 const string& getValue() const { return value; }
00033 void setValue(const string& newValue) { value = newValue; }
00034
00035 friend std::ostream& operator<<(std::ostream&, const Content&);
00036 };
00037
00038 }}
00039
00040
00041 #endif