summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/Serializer.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-04-02 17:56:14 +0000
committerAlan Conway <aconway@apache.org>2008-04-02 17:56:14 +0000
commit213961a20d63578f36d5c42acae175b539e2965f (patch)
tree1d71d1ac8f854f94972cf72affd17a250d81c958 /cpp/src/qpid/Serializer.h
parente2611af099984e1e2eea65cded8140a21136ddbf (diff)
downloadqpid-python-213961a20d63578f36d5c42acae175b539e2965f.tar.gz
Encoding/decoding for new types: amqp_0_10::Map, amqp_0_10:UnknownType
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@643995 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/Serializer.h')
-rw-r--r--cpp/src/qpid/Serializer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/src/qpid/Serializer.h b/cpp/src/qpid/Serializer.h
index e0e29e24fd..12bcded0f7 100644
--- a/cpp/src/qpid/Serializer.h
+++ b/cpp/src/qpid/Serializer.h
@@ -28,6 +28,16 @@
namespace qpid {
namespace serialize {
+/** Wrapper to pass serializer functors by reference. */
+template <class S> struct SRef {
+ S& s;
+ SRef(S& ss) : s(ss) {}
+ template <class T> typename S::result_type operator()(T& x) { return s(x); }
+ template <class T> typename S::result_type operator()(const T& x) { return s(x); }
+};
+
+template <class S> SRef<S> ref(S& s) { return SRef<S>(s); }
+
// FIXME aconway 2008-03-03: Document.
// Encoder/Decoder concept: add op() for primitive types, raw(),
// op()(Iter, Iter). Note split, encode, decode.