diff options
| author | Alan Conway <aconway@apache.org> | 2008-09-26 17:11:19 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-09-26 17:11:19 +0000 |
| commit | b22dd47558cc11572d080ac25808012092dda597 (patch) | |
| tree | 32c1948cfa796d74bbb8e5d137c1413900311b22 /cpp/src/qpid/broker | |
| parent | 13214589d918524d7058b673098fea03179290bd (diff) | |
| download | qpid-python-b22dd47558cc11572d080ac25808012092dda597.tar.gz | |
Fix build problems on rhel 5.2 and 64-bit encoding bug.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@699413 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/Connection.h | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/ExchangeRegistry.h | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Queue.h | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/QueueBindings.h | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/QueueRegistry.h | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SemanticState.h | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SessionState.h | 2 |
7 files changed, 13 insertions, 15 deletions
diff --git a/cpp/src/qpid/broker/Connection.h b/cpp/src/qpid/broker/Connection.h index a38c89156e..87cda02971 100644 --- a/cpp/src/qpid/broker/Connection.h +++ b/cpp/src/qpid/broker/Connection.h @@ -98,7 +98,7 @@ class Connection : public sys::ConnectionInputHandler, void setUserId(const string& uid); void setFederationLink(bool b); - template <class F> void eachSessionHandler(const F& f) { + template <class F> void eachSessionHandler(F f) { for (ChannelMap::iterator i = channels.begin(); i != channels.end(); ++i) f(*ptr_map_ptr(i)); } diff --git a/cpp/src/qpid/broker/ExchangeRegistry.h b/cpp/src/qpid/broker/ExchangeRegistry.h index 959e073ddc..58cbca3d92 100644 --- a/cpp/src/qpid/broker/ExchangeRegistry.h +++ b/cpp/src/qpid/broker/ExchangeRegistry.h @@ -62,10 +62,10 @@ class ExchangeRegistry{ void registerType(const std::string& type, FactoryFunction); /** Call f for each exchange in the registry. */ - template <class F> void eachExchange(const F& f) const { + template <class F> void eachExchange(F f) const { qpid::sys::RWlock::ScopedWlock l(lock); - std::for_each(exchanges.begin(), exchanges.end(), - boost::bind(f, boost::bind(&ExchangeMap::value_type::second, _1))); + for (ExchangeMap::const_iterator i = exchanges.begin(); i != exchanges.end(); ++i) + f(i->second); } private: diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h index 324e6fa1a1..d90e1be3d1 100644 --- a/cpp/src/qpid/broker/Queue.h +++ b/cpp/src/qpid/broker/Queue.h @@ -213,13 +213,13 @@ namespace qpid { ManagementMethod (uint32_t methodId, management::Args& args, std::string& text); /** Apply f to each Message on the queue. */ - template <class F> void eachMessage(const F& f) const { + template <class F> void eachMessage(F f) const { sys::Mutex::ScopedLock l(messageLock); std::for_each(messages.begin(), messages.end(), f); } /** Apply f to each QueueBinding on the queue */ - template <class F> void eachBinding(const F& f) { + template <class F> void eachBinding(F f) { bindings.eachBinding(f); } diff --git a/cpp/src/qpid/broker/QueueBindings.h b/cpp/src/qpid/broker/QueueBindings.h index bcebb5bf0a..1b90ba5540 100644 --- a/cpp/src/qpid/broker/QueueBindings.h +++ b/cpp/src/qpid/broker/QueueBindings.h @@ -44,7 +44,7 @@ class QueueBindings public: /** Apply f to each QueueBinding. */ - template <class F> void eachBinding(const F& f) const { std::for_each(bindings.begin(), bindings.end(), f); } + template <class F> void eachBinding(F f) const { std::for_each(bindings.begin(), bindings.end(), f); } void add(const std::string& exchange, const std::string& key, const qpid::framing::FieldTable& args); void unbind(ExchangeRegistry& exchanges, boost::shared_ptr<Queue> queue); diff --git a/cpp/src/qpid/broker/QueueRegistry.h b/cpp/src/qpid/broker/QueueRegistry.h index 2dc5d9c534..90df662cbe 100644 --- a/cpp/src/qpid/broker/QueueRegistry.h +++ b/cpp/src/qpid/broker/QueueRegistry.h @@ -102,10 +102,10 @@ class QueueRegistry{ void setParent (management::Manageable* _parent) { parent = _parent; } /** Call f for each queue in the registry. */ - template <class F> void eachQueue(const F& f) const { + template <class F> void eachQueue(F f) const { qpid::sys::RWlock::ScopedWlock l(lock); - std::for_each(queues.begin(), queues.end(), - boost::bind(f, boost::bind(&QueueMap::value_type::second, _1))); + for (QueueMap::const_iterator i = queues.begin(); i != queues.end(); ++i) + f(i->second); } private: diff --git a/cpp/src/qpid/broker/SemanticState.h b/cpp/src/qpid/broker/SemanticState.h index df631883f6..8207212fd9 100644 --- a/cpp/src/qpid/broker/SemanticState.h +++ b/cpp/src/qpid/broker/SemanticState.h @@ -204,10 +204,8 @@ class SemanticState : public sys::OutputTask, void attached(); void detached(); - template <class F> void eachConsumer(const F& f) { - outputTasks.eachOutput( - boost::bind(f, boost::bind(&boost::polymorphic_downcast<ConsumerImpl*, OutputTask>, _1))); - } + static ConsumerImpl* castToConsumerImpl(OutputTask* p) { return boost::polymorphic_downcast<ConsumerImpl*>(p); } + template <class F> void eachConsumer(F f) { outputTasks.eachOutput(boost::bind(f, boost::bind(castToConsumerImpl, _1))); } }; }} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/SessionState.h b/cpp/src/qpid/broker/SessionState.h index bdef894f9f..66eba9d2a9 100644 --- a/cpp/src/qpid/broker/SessionState.h +++ b/cpp/src/qpid/broker/SessionState.h @@ -100,7 +100,7 @@ class SessionState : public qpid::SessionState, void readyToSend(); - template <class F> void eachConsumer(const F& f) { semanticState.eachConsumer(f); } + template <class F> void eachConsumer(F f) { semanticState.eachConsumer(f); } private: |
