From cc55340d5d7cf74d045f5f7608aa03c5fa7a4675 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 21 Feb 2008 02:58:37 +0000 Subject: AMQP 0-10 type system: - new lightweight templated serialization framework - all fixed-size built-in types tested and working - all vbin & str types implemented, tests disabled need to fix encoding. The following types remain to be implemented: byte-ranges 2 byte ranges within a 64-bit payload sequence-set 2 ranged set representation map 0xa8 4 a mapping of keys to typed values list 0xa9 4 a series of consecutive type-value pairs array 0xaa 4 a defined length collection of values of a single type struct32 0xab 4 a coded struct with a 32-bit size git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@629679 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/SequenceNumber.h | 2 ++ cpp/src/qpid/framing/Uuid.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'cpp/src/qpid/framing') diff --git a/cpp/src/qpid/framing/SequenceNumber.h b/cpp/src/qpid/framing/SequenceNumber.h index 3aee04a4ce..b2594452d0 100644 --- a/cpp/src/qpid/framing/SequenceNumber.h +++ b/cpp/src/qpid/framing/SequenceNumber.h @@ -50,6 +50,8 @@ class SequenceNumber operator uint32_t() const { return (uint32_t) value; } friend int32_t operator-(const SequenceNumber& a, const SequenceNumber& b); + + template void serialize(S& s) { s(value); } }; struct Window diff --git a/cpp/src/qpid/framing/Uuid.h b/cpp/src/qpid/framing/Uuid.h index 9bde67ad8e..278a60c439 100644 --- a/cpp/src/qpid/framing/Uuid.h +++ b/cpp/src/qpid/framing/Uuid.h @@ -65,6 +65,10 @@ struct Uuid : public boost::array { /** String value in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb */ std::string str() const; + + template void serialize(S& s) { + s(static_cast&>(*this)); + } }; /** Print in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb */ -- cgit v1.2.1