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 | |
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')
-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 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.h | 10 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/DumpClient.cpp | 7 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Event.cpp | 6 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Event.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/sys/AggregateOutput.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/sys/PollableQueue.h | 2 |
14 files changed, 32 insertions, 29 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: diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index 7edf9f9392..c1775616a8 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -115,7 +115,7 @@ void Cluster::mcastControl(const framing::AMQBody& body, Connection* cptr) { mcastEvent(e); } -void Cluster::mcastBuffer(const char* data, size_t size, const ConnectionId& connection, size_t id) { +void Cluster::mcastBuffer(const char* data, size_t size, const ConnectionId& connection, uint32_t id) { Event e(DATA, connection, size, id); memcpy(e.getData(), data, size); QPID_LOG(trace, "MCAST " << e); diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h index ec43c56c69..eaa91202dc 100644 --- a/cpp/src/qpid/cluster/Cluster.h +++ b/cpp/src/qpid/cluster/Cluster.h @@ -77,7 +77,7 @@ class Cluster : private Cpg::Handler, public management::Manageable /** Send to the cluster */ void mcastControl(const framing::AMQBody& controlBody, Connection* cptr); - void mcastBuffer(const char*, size_t, const ConnectionId&, size_t id); + void mcastBuffer(const char*, size_t, const ConnectionId&, uint32_t id); void mcastEvent(const Event& e); /** Leave the cluster */ @@ -97,8 +97,8 @@ class Cluster : private Cpg::Handler, public management::Manageable void setDumpComplete(); template <class F> void eachConnection(const F& f) { - std::for_each(connections.begin(), connections.end(), - boost::bind(f, boost::bind(&ConnectionMap::value_type::second, _1))); + for (ConnectionMap::const_iterator i = connections.begin(); i != connections.end(); ++i) + f(i->second); } private: @@ -143,7 +143,7 @@ class Cluster : private Cpg::Handler, public management::Manageable virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text); void stopClusterNode(void); void stopFullCluster(void); - void updateMemberStats(void); + void updateMemberStats(void); mutable sys::Monitor lock; // Protect access to members. broker::Broker& broker; @@ -165,7 +165,7 @@ class Cluster : private Cpg::Handler, public management::Manageable JoiningHandler joiningHandler; MemberHandler memberHandler; - size_t mcastId; + uint32_t mcastId; friend class ClusterHandler; friend class JoiningHandler; diff --git a/cpp/src/qpid/cluster/DumpClient.cpp b/cpp/src/qpid/cluster/DumpClient.cpp index ee87afb468..d2d3c9bb15 100644 --- a/cpp/src/qpid/cluster/DumpClient.cpp +++ b/cpp/src/qpid/cluster/DumpClient.cpp @@ -168,6 +168,10 @@ void DumpClient::dumpConnection(const boost::intrusive_ptr<Connection>& dumpConn QPID_LOG(debug, donor.getId() << " dumped connection " << *dumpConnection); } +// FIXME aconway 2008-09-26: REMOVE +void foo(broker::SemanticState::ConsumerImpl*) {} + + void DumpClient::dumpSession(broker::SessionHandler& sh) { QPID_LOG(debug, donor.getId() << " dumping session " << &sh.getConnection() << "[" << sh.getChannel() << "] = " << sh.getSession()->getId()); @@ -187,7 +191,8 @@ void DumpClient::dumpSession(broker::SessionHandler& sh) { // Re-create session state on remote connection. broker::SessionState* ss = sh.getSession(); - ss->eachConsumer(boost::bind(&DumpClient::dumpConsumer, this, _1)); + // For reasons unknown, boost::bind does not work here with boost 1.33. + ss->eachConsumer(std::bind1st(std::mem_fun(&DumpClient::dumpConsumer),this)); // FIXME aconway 2008-09-19: remaining session state. diff --git a/cpp/src/qpid/cluster/Event.cpp b/cpp/src/qpid/cluster/Event.cpp index 43335e3607..2531001504 100644 --- a/cpp/src/qpid/cluster/Event.cpp +++ b/cpp/src/qpid/cluster/Event.cpp @@ -31,16 +31,16 @@ namespace cluster { using framing::Buffer; -const size_t Event::OVERHEAD = sizeof(uint8_t) + sizeof(uint64_t) + sizeof(size_t); +const size_t Event::OVERHEAD = sizeof(uint8_t) + sizeof(uint64_t) + sizeof(uint32_t); -Event::Event(EventType t, const ConnectionId& c, size_t s, size_t i) +Event::Event(EventType t, const ConnectionId& c, size_t s, uint32_t i) : type(t), connectionId(c), size(s), data(RefCountedBuffer::create(s)), id(i) {} Event Event::delivered(const MemberId& m, void* d, size_t s) { Buffer buf(static_cast<char*>(d), s); EventType type((EventType)buf.getOctet()); ConnectionId connection(m, reinterpret_cast<Connection*>(buf.getLongLong())); - size_t id = buf.getLong(); + uint32_t id = buf.getLong(); assert(buf.getPosition() == OVERHEAD); Event e(type, connection, s-OVERHEAD, id); memcpy(e.getData(), static_cast<char*>(d)+OVERHEAD, s-OVERHEAD); diff --git a/cpp/src/qpid/cluster/Event.h b/cpp/src/qpid/cluster/Event.h index 12a7a9388a..6d8655392e 100644 --- a/cpp/src/qpid/cluster/Event.h +++ b/cpp/src/qpid/cluster/Event.h @@ -43,7 +43,7 @@ namespace cluster { class Event { public: /** Create an event to mcast with a buffer of size bytes. */ - Event(EventType t=DATA, const ConnectionId& c=ConnectionId(), size_t size=0, size_t id=0); + Event(EventType t=DATA, const ConnectionId& c=ConnectionId(), size_t size=0, uint32_t id=0); /** Create an event copied from delivered data. */ static Event delivered(const MemberId& m, void* data, size_t size); @@ -65,7 +65,7 @@ class Event { ConnectionId connectionId; size_t size; RefCountedBuffer::pointer data; - size_t id; + uint32_t id; }; std::ostream& operator << (std::ostream&, const Event&); diff --git a/cpp/src/qpid/sys/AggregateOutput.h b/cpp/src/qpid/sys/AggregateOutput.h index af26601f76..0b08cd6f5f 100644 --- a/cpp/src/qpid/sys/AggregateOutput.h +++ b/cpp/src/qpid/sys/AggregateOutput.h @@ -50,7 +50,7 @@ namespace sys { void removeOutputTask(OutputTask* t); /** Apply f to each OutputTask* in the tasks list */ - template <class F> void eachOutput(const F& f) { + template <class F> void eachOutput(F f) { std::for_each(tasks.begin(), tasks.end(), f); } }; diff --git a/cpp/src/qpid/sys/PollableQueue.h b/cpp/src/qpid/sys/PollableQueue.h index 2c326b998f..3a94c60be0 100644 --- a/cpp/src/qpid/sys/PollableQueue.h +++ b/cpp/src/qpid/sys/PollableQueue.h @@ -53,7 +53,7 @@ class PollableQueue { /** @see forEach() */ template <class F> struct ForEach { F handleOne; - ForEach(const F& f) : handleOne(f) {} + ForEach(F f) : handleOne(f) {} void operator()(const iterator& i, const iterator& j) const { std::for_each(i, j, handleOne); } }; |