diff options
| author | Alan Conway <aconway@apache.org> | 2008-04-15 18:23:55 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-04-15 18:23:55 +0000 |
| commit | 04f90cff6570c8f035eaa2a86fa31ebd1caf3f0f (patch) | |
| tree | 4567305f8974177a74655738a694ff2bc167bc59 /cpp/src/qpid/amqp_0_10/UnknownStruct.h | |
| parent | 2a0efe8231595bc6bb891b525427297ce446c20a (diff) | |
| download | qpid-python-04f90cff6570c8f035eaa2a86fa31ebd1caf3f0f.tar.gz | |
Correct Struct32 encoding: size/code/data.
Proper re-encoding for unknown struct codes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@648362 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/amqp_0_10/UnknownStruct.h')
| -rw-r--r-- | cpp/src/qpid/amqp_0_10/UnknownStruct.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/qpid/amqp_0_10/UnknownStruct.h b/cpp/src/qpid/amqp_0_10/UnknownStruct.h index d4fc77159b..99ba170328 100644 --- a/cpp/src/qpid/amqp_0_10/UnknownStruct.h +++ b/cpp/src/qpid/amqp_0_10/UnknownStruct.h @@ -22,18 +22,30 @@ * */ #include "qpid/amqp_0_10/complex_types.h" +#include <string> namespace qpid { namespace amqp_0_10 { -struct UnknownStruct : public Struct, public Vbin32 { +class UnknownStruct : public Struct { + public: static const uint8_t SIZE=4; static const uint8_t PACK=2; - + + template <class S> void serialize(S& s) { s.split(*this); s(data.begin(), data.end()); } + template <class S> void encode(S&) const { } + template <class S> void decode(S& s) { data.resize(s.bytesRemaining()); } + UnknownStruct(uint8_t cc=0, uint8_t c=0) : classCode(cc), code(c) {} void accept(Visitor&); void accept(ConstVisitor&) const; + + uint8_t getClassCode() const { return classCode; } + uint8_t getCode() const { return code; } + + private: uint8_t classCode, code; + std::string data; }; std::ostream& operator<<(std::ostream&, const UnknownStruct&); |
