summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-02-21 02:58:37 +0000
committerAlan Conway <aconway@apache.org>2008-02-21 02:58:37 +0000
commitcc55340d5d7cf74d045f5f7608aa03c5fa7a4675 (patch)
treeb4fab5adce9886a328d3f646be674c108503a94a /cpp/src/qpid/framing
parenta00fe37e0854df1bdd9e0187873d3d1c8972eeb8 (diff)
downloadqpid-python-cc55340d5d7cf74d045f5f7608aa03c5fa7a4675.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/framing')
-rw-r--r--cpp/src/qpid/framing/SequenceNumber.h2
-rw-r--r--cpp/src/qpid/framing/Uuid.h4
2 files changed, 6 insertions, 0 deletions
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 <class S> 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<uint8_t, 16> {
/** String value in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb */
std::string str() const;
+
+ template <class S> void serialize(S& s) {
+ s(static_cast<boost::array<uint8_t, 16>&>(*this));
+ }
};
/** Print in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb */