diff options
| author | Alan Conway <aconway@apache.org> | 2007-08-21 23:35:23 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-08-21 23:35:23 +0000 |
| commit | 9ef0c3dc8bc5ef4af668a3c19f8e254fb5e01ada (patch) | |
| tree | b8afa05ed63e9d2d05392df406053c0d69d2fc36 /cpp/src/qpid/broker | |
| parent | 9ebcf9839197cafe78beb8dfa14b803bd78f5a5e (diff) | |
| download | qpid-python-9ef0c3dc8bc5ef4af668a3c19f8e254fb5e01ada.tar.gz | |
* src/qpid/sys/Serializer.h, .cpp:
Template Serializer on functor for execute().
Old Serializer equivalent to Serializer<boost::function<void()> >
* src/qpid/broker/BrokerQueue.h, .cpp:
Use hand-written functor for Serializer instead of boost::function.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568332 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/BrokerQueue.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/BrokerQueue.h | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/BrokerQueue.cpp b/cpp/src/qpid/broker/BrokerQueue.cpp index 706179fb52..5ff9f950eb 100644 --- a/cpp/src/qpid/broker/BrokerQueue.cpp +++ b/cpp/src/qpid/broker/BrokerQueue.cpp @@ -50,7 +50,7 @@ Queue::Queue(const string& _name, bool _autodelete, exclusive(0), persistenceId(0), serializer(false), - dispatchCallback(boost::bind(&Queue::dispatch, this)) + dispatchCallback(*this) { } diff --git a/cpp/src/qpid/broker/BrokerQueue.h b/cpp/src/qpid/broker/BrokerQueue.h index 35aa954c1e..962c11d8ee 100644 --- a/cpp/src/qpid/broker/BrokerQueue.h +++ b/cpp/src/qpid/broker/BrokerQueue.h @@ -60,6 +60,12 @@ namespace qpid { typedef std::vector<Consumer*> Consumers; typedef std::deque<Message::shared_ptr> Messages; + struct DispatchFunctor { + Queue& queue; + DispatchFunctor(Queue& q) : queue(q) {} + void operator()() { queue.dispatch(); } + }; + const string name; const bool autodelete; MessageStore* const store; @@ -75,8 +81,8 @@ namespace qpid { std::auto_ptr<QueuePolicy> policy; QueueBindings bindings; boost::shared_ptr<Exchange> alternateExchange; - qpid::sys::Serializer serializer; - qpid::sys::Serializer::Task dispatchCallback; + qpid::sys::Serializer<DispatchFunctor> serializer; + DispatchFunctor dispatchCallback; void pop(); void push(Message::shared_ptr& msg); |
