summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-09-11 11:25:27 +0000
committerGordon Sim <gsim@apache.org>2007-09-11 11:25:27 +0000
commitc922ccae07d060f891848e688f7f1e29dc07c552 (patch)
tree8363c1678c5efc59769c19c58188ccb9466d8aa4 /cpp/src/qpid/framing
parentfbda2ac45519f7108fc48f483d76d1487c2b3544 (diff)
downloadqpid-python-c922ccae07d060f891848e688f7f1e29dc07c552.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/framing')
-rw-r--r--cpp/src/qpid/framing/TransferContent.cpp31
-rw-r--r--cpp/src/qpid/framing/TransferContent.h13
2 files changed, 43 insertions, 1 deletions
diff --git a/cpp/src/qpid/framing/TransferContent.cpp b/cpp/src/qpid/framing/TransferContent.cpp
index 1faa24ae0c..4c2d06ae42 100644
--- a/cpp/src/qpid/framing/TransferContent.cpp
+++ b/cpp/src/qpid/framing/TransferContent.cpp
@@ -61,4 +61,35 @@ DeliveryProperties& TransferContent::getDeliveryProperties()
return *header.get<DeliveryProperties>(true);
}
+void TransferContent::populate(const FrameSet& frameset)
+{
+ header = *frameset.getHeaders();
+ frameset.getContent(data);
+}
+
+const MessageProperties& TransferContent::getMessageProperties() const
+{
+ const MessageProperties* props = header.get<MessageProperties>();
+ if (!props) throw NoSuchPropertiesException();
+ return *props;
+}
+
+const DeliveryProperties& TransferContent::getDeliveryProperties() const
+{
+ const DeliveryProperties* props = header.get<DeliveryProperties>();
+ if (!props) throw NoSuchPropertiesException();
+ return *props;
+}
+
+bool TransferContent::hasMessageProperties() const
+{
+ return header.get<MessageProperties>();
+}
+
+bool TransferContent::hasDeliveryProperties() const
+{
+ return header.get<DeliveryProperties>();
+}
+
+
}}
diff --git a/cpp/src/qpid/framing/TransferContent.h b/cpp/src/qpid/framing/TransferContent.h
index 14ba209f4b..c5fc395c94 100644
--- a/cpp/src/qpid/framing/TransferContent.h
+++ b/cpp/src/qpid/framing/TransferContent.h
@@ -21,13 +21,17 @@
#ifndef _TransferContent_
#define _TransferContent_
+#include "FrameSet.h"
#include "MethodContent.h"
+#include "qpid/Exception.h"
#include "qpid/framing/MessageProperties.h"
#include "qpid/framing/DeliveryProperties.h"
namespace qpid {
namespace framing {
+struct NoSuchPropertiesException : public Exception {};
+
class TransferContent : public MethodContent
{
AMQHeaderBody header;
@@ -37,9 +41,16 @@ public:
AMQHeaderBody getHeader() const;
void setData(const std::string&);
void appendData(const std::string&);
- const std::string& getData() const;
MessageProperties& getMessageProperties();
DeliveryProperties& getDeliveryProperties();
+
+ const std::string& getData() const;
+ const MessageProperties& getMessageProperties() const;
+ const DeliveryProperties& getDeliveryProperties() const;
+ bool hasMessageProperties() const;
+ bool hasDeliveryProperties() const;
+
+ void populate(const FrameSet& frameset);
};
}}