diff options
| author | Alan Conway <aconway@apache.org> | 2008-04-16 15:33:51 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-04-16 15:33:51 +0000 |
| commit | 775aa6924e2c432791fafd354751bb068129fe2e (patch) | |
| tree | 920584acaa99df0a6f8d55e53eefc9b38767e519 /cpp/src/qpid/amqp_0_10/Struct32.h | |
| parent | 79749f81fab85090506e236f8b625801291659a1 (diff) | |
| download | qpid-python-775aa6924e2c432791fafd354751bb068129fe2e.tar.gz | |
Fix encoding for sized structs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@648724 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/amqp_0_10/Struct32.h')
| -rw-r--r-- | cpp/src/qpid/amqp_0_10/Struct32.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cpp/src/qpid/amqp_0_10/Struct32.h b/cpp/src/qpid/amqp_0_10/Struct32.h index 1f0c116f91..2ed73e0b4c 100644 --- a/cpp/src/qpid/amqp_0_10/Struct32.h +++ b/cpp/src/qpid/amqp_0_10/Struct32.h @@ -30,23 +30,24 @@ namespace amqp_0_10 { class Struct32 : public StructHolder { public: - Struct32() {} + Struct32(); template <class T> explicit Struct32(const T& t) : StructHolder(t) {} - template <class S> void serialize(S& s) { - s.split(*this); - StructHolder::serialize(s); - } + template <class S> void serialize(S& s) { s.split(*this); } + + using StructHolder::operator=; template <class S> void encode(S& s) const { s(contentSize()); + const_cast<Struct32*>(this)->StructHolder::serialize(s); } template <class S> void decode(S& s) { uint32_t contentSz; s(contentSz); - s.setLimit(contentSz); + typename S::ScopedLimit l(s, contentSz); + StructHolder::serialize(s); } private: |
