From e72e25abd1272c4e9489f7efd5bc02c4ecf0b5cd Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 8 Apr 2008 19:53:07 +0000 Subject: Summary: added 0-10 Array encoding and decoding. rubygen/0-10/allsegmenttypes.rb: test header,body and each command and control type. rubygen/0-10/specification.rb: enable packed encoding. src/qpid/amqp_0_10/Array.h: Implemented array and array domains. src/qpid/amqp_0_10/Codec.h: enable litte-endian encoding for pack bits src/qpid/amqp_0_10/Packer.h: use litte-endian encoding for pack bits src/qpid/amqp_0_10/Unit.cpp, .h: setting flags, fix op <<. src/qpid/amqp_0_10/complex_types.cpp, .h: added op << src/qpid/framing/Blob.h: copy-object template constructor. src/tests/amqp_0_10/serialize.cpp: - test Array Minor adjustments for new Array.h: src/qpid/amqp_0_10/Map.cpp src/qpid/amqp_0_10/Map.h src/qpid/amqp_0_10/UnknownType.h src/qpid/amqp_0_10/built_in_types.h src/qpid/amqp_0_10/Body.h git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@646054 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/Blob.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cpp/src/qpid/framing') diff --git a/cpp/src/qpid/framing/Blob.h b/cpp/src/qpid/framing/Blob.h index 344e4ac4db..cf81f693b0 100644 --- a/cpp/src/qpid/framing/Blob.h +++ b/cpp/src/qpid/framing/Blob.h @@ -85,10 +85,6 @@ template <> struct BlobHelper { * In particular the user must ensure the blob is big enough for its * contents and must know the type of object in the blob to cast get(). * - * Objects can be allocated directly in place using - * construct(in_place(...)) or copied using operator=. - * Constructing a new object in the blob destroys the old one. - * * If BaseType is specified then only object that can be * safely static_cast to BaseType may be stored in the Blob. */ @@ -140,12 +136,18 @@ class Blob /** Copy a blob. */ Blob(const Blob& b) { initialize(); assign(b); } - /** @see construct() */ + /** Construct from in_place constructor */ template Blob(const InPlace & expr, typename EnableInPlace::type* =0) { initialize(); apply(expr); } + /** Construct by copying an objecct constructor */ + template + Blob(const T & t, typename DisableInPlace::type* =0) { + initialize(); apply(in_place(t)); + } + ~Blob() { clear(); } /** Assign from another blob. */ -- cgit v1.2.1