From c922ccae07d060f891848e688f7f1e29dc07c552 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 11 Sep 2007 11:25:27 +0000 Subject: Moved old ClientChannel class from using basic to using message for publish & consume. (Get and qos still use the basic class's defintions, that will be changed next) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@574551 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ClientMessage.h | 66 ++++++++++++++----------------------- 1 file changed, 24 insertions(+), 42 deletions(-) (limited to 'cpp/src/qpid/client/ClientMessage.h') diff --git a/cpp/src/qpid/client/ClientMessage.h b/cpp/src/qpid/client/ClientMessage.h index 1afe5585a9..5c4eb4e5aa 100644 --- a/cpp/src/qpid/client/ClientMessage.h +++ b/cpp/src/qpid/client/ClientMessage.h @@ -22,13 +22,7 @@ * */ #include -#include "qpid/framing/BasicHeaderProperties.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/framing/MethodContent.h" - -#include "qpid/framing/BasicDeliverBody.h" -#include "qpid/framing/BasicGetOkBody.h" -#include "qpid/framing/MessageTransferBody.h" +#include "qpid/framing/TransferContent.h" namespace qpid { namespace client { @@ -39,49 +33,37 @@ namespace client { * * \ingroup clientapi */ -// FIXME aconway 2007-04-05: Should be based on MessageTransfer properties not -// basic header properties. -class Message : public framing::BasicHeaderProperties, public framing::MethodContent { - public: - Message(const std::string& data_=std::string()) : data(data_) {} - - const std::string& getData() const { return data; } - void setData(const std::string& _data) { data = _data; } - - std::string getDestination() const { return destination; } - void setDestination(const std::string& dest) { destination = dest; } +class Message : public framing::TransferContent +{ +public: + Message(const std::string& data_=std::string()) : TransferContent(data_) {} - // TODO aconway 2007-03-22: only needed for Basic.deliver support. - uint64_t getDeliveryTag() const { return deliveryTag; } - void setDeliveryTag(uint64_t dt) { deliveryTag = dt; } - - bool isRedelivered() const { return redelivered; } - void setRedelivered(bool _redelivered){ redelivered = _redelivered; } + std::string getDestination() const + { + return destination; + } + + void setDestination(const std::string& dest) + { + destination = dest; + } - framing::AMQHeaderBody getHeader() const + bool isRedelivered() const { - framing::AMQHeaderBody header; - BasicHeaderProperties* properties = header.get(true); - BasicHeaderProperties::copy(*properties, *this); - properties->setContentLength(data.size()); - return header; + return hasDeliveryProperties() && getDeliveryProperties().getRedelivered(); } - //TODO: move this elsewhere (GRS 24/08/2007) - void populate(framing::FrameSet& frameset) - { - const BasicHeaderProperties* properties = frameset.getHeaders()->get(); - if (properties) { - BasicHeaderProperties::copy(*this, *properties); - } - frameset.getContent(data); + void setRedelivered(bool redelivered) { + getDeliveryProperties().setRedelivered(redelivered); + } + + framing::FieldTable& getHeaders() + { + return getMessageProperties().getApplicationHeaders(); } - private: - std::string data; +private: std::string destination; - bool redelivered; - uint64_t deliveryTag; }; }} -- cgit v1.2.1