diff options
author | Alan Conway <aconway@apache.org> | 2008-09-06 14:10:08 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-09-06 14:10:08 +0000 |
commit | 028745dbc3c47bd6561310678f82f15bd45678d9 (patch) | |
tree | 036ac009b7ccbcafcf4b6c2aa375bb19237f5a0e /cpp/src/qpid/cluster/Event.h | |
parent | 3bb7782cb0904f0abf61b7fb28da7bce905ceb08 (diff) | |
download | qpid-python-028745dbc3c47bd6561310678f82f15bd45678d9.tar.gz |
RefCountedBuffer improvements, centralize cluster encoding/decoding in Event.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@692654 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Event.h')
-rw-r--r-- | cpp/src/qpid/cluster/Event.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/qpid/cluster/Event.h b/cpp/src/qpid/cluster/Event.h index 14ae253dc2..d0e12831f4 100644 --- a/cpp/src/qpid/cluster/Event.h +++ b/cpp/src/qpid/cluster/Event.h @@ -26,6 +26,7 @@ #include "Cpg.h" #include "qpid/RefCountedBuffer.h" #include "qpid/framing/Buffer.h" +#include <iosfwd> namespace qpid { namespace cluster { @@ -46,24 +47,25 @@ struct Event { /** Create an event copied from delivered data. */ static Event delivered(const MemberId& m, void* data, size_t size); - void mcast(const Cpg::Name& name, Cpg& cpg); + void mcast(const Cpg::Name& name, Cpg& cpg) const; EventType getType() const { return type; } ConnectionId getConnection() const { return connection; } size_t getSize() const { return size; } - char* getData() { return data->get(); } - const char* getData() const { return data->get(); } + char* getData() { return data; } + const char* getData() const { return data; } - operator framing::Buffer() const { return framing::Buffer(const_cast<char*>(getData()), getSize()); } + operator framing::Buffer() const; private: static const size_t OVERHEAD; EventType type; ConnectionId connection; size_t size; - RefCountedBuffer::intrusive_ptr data; + RefCountedBuffer::pointer data; }; +std::ostream& operator << (std::ostream&, const Event&); }} // namespace qpid::cluster #endif /*!QPID_CLUSTER_EVENT_H*/ |