From 86dfb3e98b4c680db636bdbcd1fb63e7b0784f2b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Sat, 18 Aug 2007 03:34:09 +0000 Subject: * src/qpid/framing/MethodHolder.h * src/qpid/framing/Blob.h - add empty() test - get() returns 0 when empty * src/qpid/client/Response.h: assert checks. * src/tests/perftest.cpp: default to listen and publish. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@567221 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/MethodHolder.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cpp/src/qpid/framing/MethodHolder.h') diff --git a/cpp/src/qpid/framing/MethodHolder.h b/cpp/src/qpid/framing/MethodHolder.h index 59dbb1a708..a8bc8f2728 100644 --- a/cpp/src/qpid/framing/MethodHolder.h +++ b/cpp/src/qpid/framing/MethodHolder.h @@ -75,13 +75,13 @@ class MethodHolder void encode(Buffer&) const; void decode(Buffer&); uint32_t size() const; - - AMQMethodBody* get() { - return reinterpret_cast(blob.get()); - } - const AMQMethodBody* get() const { - return reinterpret_cast(blob.get()); - } + + /** Return method pointer or 0 if empty. */ + AMQMethodBody* get(); + const AMQMethodBody* get() const; + + /** True if no method has been set */ + bool empty() const { return blob.empty(); } private: Blob blob; -- cgit v1.2.1