summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/AMQBody.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/framing/AMQBody.h')
-rw-r--r--cpp/src/qpid/framing/AMQBody.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/framing/AMQBody.h b/cpp/src/qpid/framing/AMQBody.h
index 93f4319575..9e66b9738f 100644
--- a/cpp/src/qpid/framing/AMQBody.h
+++ b/cpp/src/qpid/framing/AMQBody.h
@@ -22,7 +22,9 @@
*
*/
#include "qpid/framing/amqp_types.h"
-
+#include "qpid/RefCounted.h"
+#include "qpid/framing/BodyFactory.h"
+#include <boost/intrusive_ptr.hpp>
#include <ostream>
namespace qpid {
@@ -43,11 +45,15 @@ struct AMQBodyConstVisitor {
virtual void visit(const AMQMethodBody&) = 0;
};
-class AMQBody
-{
+class AMQBody : public RefCounted {
public:
+ AMQBody() {}
virtual ~AMQBody();
+ // Make AMQBody copyable even though RefCounted.
+ AMQBody(const AMQBody&) : RefCounted() {}
+ AMQBody& operator=(const AMQBody&) { return *this; }
+
virtual uint8_t type() const = 0;
virtual void encode(Buffer& buffer) const = 0;
@@ -62,6 +68,7 @@ class AMQBody
/** Match if same type and same class/method ID for methods */
static bool match(const AMQBody& , const AMQBody& );
+ virtual boost::intrusive_ptr<AMQBody> clone() const = 0;
};
std::ostream& operator<<(std::ostream& out, const AMQBody& body) ;