diff options
Diffstat (limited to 'cpp/src/qpid/broker/Consumer.h')
-rw-r--r-- | cpp/src/qpid/broker/Consumer.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/Consumer.h b/cpp/src/qpid/broker/Consumer.h index b96443fa7c..2af9b0c121 100644 --- a/cpp/src/qpid/broker/Consumer.h +++ b/cpp/src/qpid/broker/Consumer.h @@ -29,22 +29,33 @@ namespace qpid { namespace broker { class Queue; +class QueueListeners; class Consumer { const bool acquires; - public: - typedef boost::shared_ptr<Consumer> shared_ptr; - + // inListeners allows QueueListeners to efficiently track if this instance is registered + // for notifications without having to search its containers + bool inListeners; + // the name is generated by broker and is unique within broker scope. It is not + // provided or known by the remote Consumer. + const std::string name; + public: + typedef boost::shared_ptr<Consumer> shared_ptr; + framing::SequenceNumber position; - - Consumer(bool preAcquires = true) : acquires(preAcquires) {} + + Consumer(const std::string& _name, bool preAcquires = true) + : acquires(preAcquires), inListeners(false), name(_name), position(0) {} bool preAcquires() const { return acquires; } + const std::string& getName() const { return name; } + virtual bool deliver(QueuedMessage& msg) = 0; virtual void notify() = 0; virtual bool filter(boost::intrusive_ptr<Message>) { return true; } virtual bool accept(boost::intrusive_ptr<Message>) { return true; } virtual OwnershipToken* getSession() = 0; virtual ~Consumer(){} + friend class QueueListeners; }; }} |