summaryrefslogtreecommitdiff
path: root/cpp/lib/broker/Content.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/lib/broker/Content.h')
-rw-r--r--cpp/lib/broker/Content.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/cpp/lib/broker/Content.h b/cpp/lib/broker/Content.h
index 3058fdfd6a..1b884536f0 100644
--- a/cpp/lib/broker/Content.h
+++ b/cpp/lib/broker/Content.h
@@ -21,6 +21,8 @@
#ifndef _Content_
#define _Content_
+#include <boost/function.hpp>
+
#include <AMQContentBody.h>
#include <Buffer.h>
#include <OutputHandler.h>
@@ -34,13 +36,31 @@ class ChannelAdapter;
namespace broker {
class Content{
public:
+ typedef std::string DataBlock;
+ typedef boost::function1<void, const DataBlock&> SendFn;
+
+ virtual ~Content(){}
+
+ /** Add a block of data to the content */
+ // FIXME aconway 2007-02-07:
+ // virtual void add(const DataBlock& data) = 0;
virtual void add(framing::AMQContentBody::shared_ptr data) = 0;
+
+ /** Total size of content in bytes */
virtual u_int32_t size() = 0;
- virtual void send(framing::ChannelAdapter& channel,
- u_int32_t framesize) = 0;
+
+ /**
+ * Iterate over the content calling SendFn for each block.
+ * Subdivide blocks if necessary to ensure each block is
+ * <= framesize bytes long.
+ */
+ // FIXME aconway 2007-02-07:
+ // virtual void send(SendFn send, u_int32_t framesize) = 0;
+ virtual void send(framing::ChannelAdapter& channel, u_int32_t framesize) = 0;
+
+ //FIXME aconway 2007-02-07: This is inconsistently implemented
+ //find out what is needed.
virtual void encode(qpid::framing::Buffer& buffer) = 0;
- virtual void destroy() = 0;
- virtual ~Content(){}
};
}}