diff options
author | Gordon Sim <gsim@apache.org> | 2007-03-30 15:50:07 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-03-30 15:50:07 +0000 |
commit | 72bca07ee53fb9476f268133f244d55d8f53d3b9 (patch) | |
tree | 6e8400200b22188899144a025ecb1a6c5922cc7b /qpid/cpp/lib/broker/BrokerMessageBase.h | |
parent | 61c7761f005dacfc5938a4d4d25b7120a8e21620 (diff) | |
download | qpid-python-72bca07ee53fb9476f268133f244d55d8f53d3b9.tar.gz |
Refactored the MessageStore interface to restrict visibility of broker core from store implementations.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@524139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib/broker/BrokerMessageBase.h')
-rw-r--r-- | qpid/cpp/lib/broker/BrokerMessageBase.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/qpid/cpp/lib/broker/BrokerMessageBase.h b/qpid/cpp/lib/broker/BrokerMessageBase.h index 4989cccdd3..da0cc57756 100644 --- a/qpid/cpp/lib/broker/BrokerMessageBase.h +++ b/qpid/cpp/lib/broker/BrokerMessageBase.h @@ -25,6 +25,7 @@ #include <string> #include <boost/shared_ptr.hpp> #include "Content.h" +#include "PersistableMessage.h" #include "framing/amqp_types.h" namespace qpid { @@ -49,7 +50,7 @@ class MessageStore; * abstracting away the operations * TODO; AMS: for the moment this is mostly a placeholder */ -class Message { +class Message : public PersistableMessage{ public: typedef boost::shared_ptr<Message> shared_ptr; typedef boost::shared_ptr<framing::AMQMethodBody> AMQMethodBodyPtr; @@ -117,25 +118,25 @@ class Message { return publisher; } - virtual void encode(framing::Buffer& buffer) = 0; - virtual void encodeHeader(framing::Buffer& buffer) = 0; + virtual void encode(framing::Buffer& buffer) const = 0; + virtual void encodeHeader(framing::Buffer& buffer) const = 0; /** * @returns the size of the buffer needed to encode this * message in its entirety */ - virtual uint32_t encodedSize() = 0; + virtual uint32_t encodedSize() const = 0; /** * @returns the size of the buffer needed to encode the * 'header' of this message (not just the header frame, * but other meta data e.g.routing key and exchange) */ - virtual uint32_t encodedHeaderSize() = 0; + virtual uint32_t encodedHeaderSize() const = 0; /** * @returns the size of the buffer needed to encode the * (possibly partial) content held by this message */ - virtual uint32_t encodedContentSize() = 0; + virtual uint32_t encodedContentSize() const = 0; /** * If headers have been received, returns the expected * content size else returns 0. @@ -145,6 +146,7 @@ class Message { virtual void decodeHeader(framing::Buffer& buffer) = 0; virtual void decodeContent(framing::Buffer& buffer, uint32_t contentChunkSize = 0) = 0; + static shared_ptr decode(framing::Buffer& buffer); // TODO: AMS 29/1/2007 Don't think these are really part of base class |