diff options
| author | Alan Conway <aconway@apache.org> | 2006-10-24 13:29:05 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2006-10-24 13:29:05 +0000 |
| commit | 6920d8261ca0cdbb7e547a756a32dfd067cd15bc (patch) | |
| tree | 981846eb1ebf8070a3fc654faf1e4e4f5f42c050 /cpp/src/qpid/broker | |
| parent | 0a453564f9624bf4c0ce98194691be9ff0184e2b (diff) | |
| download | qpid-python-6920d8261ca0cdbb7e547a756a32dfd067cd15bc.tar.gz | |
QPID-52: use of tr1 and unordered_map break build or RHEL4.
Replaced unordered_map with std::map.
Use boost::shared_ptr instead of std::tr1::shared_ptr. Since we're
using boost for other things now anyway it's simpler & more portable.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@467329 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.h | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Message.cpp | 11 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Message.h | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Queue.h | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SessionHandlerImpl.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/TopicExchange.cpp | 8 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/TopicExchange.h | 13 |
7 files changed, 17 insertions, 29 deletions
diff --git a/cpp/src/qpid/broker/Broker.h b/cpp/src/qpid/broker/Broker.h index 40b171e838..8581093910 100644 --- a/cpp/src/qpid/broker/Broker.h +++ b/cpp/src/qpid/broker/Broker.h @@ -24,7 +24,7 @@ #include "qpid/concurrent/Runnable.h" #include "qpid/broker/SessionHandlerFactoryImpl.h" #include <boost/noncopyable.hpp> -#include <tr1/memory> +#include <boost/shared_ptr.hpp> namespace qpid { namespace broker { @@ -42,7 +42,7 @@ namespace qpid { static const int16_t DEFAULT_PORT; virtual ~Broker(); - typedef std::tr1::shared_ptr<Broker> shared_ptr; + typedef boost::shared_ptr<Broker> shared_ptr; /** * Create a broker. diff --git a/cpp/src/qpid/broker/Message.cpp b/cpp/src/qpid/broker/Message.cpp index 53cfe4ee43..b5292ef043 100644 --- a/cpp/src/qpid/broker/Message.cpp +++ b/cpp/src/qpid/broker/Message.cpp @@ -20,12 +20,11 @@ #include "qpid/broker/ExchangeRegistry.h" #include <iostream> -using namespace std::tr1;//for *_pointer_cast methods +using namespace boost; using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::concurrent; - Message::Message(const ConnectionToken* const _publisher, const string& _exchange, const string& _routingKey, bool _mandatory, bool _immediate) : publisher(_publisher), @@ -34,12 +33,9 @@ Message::Message(const ConnectionToken* const _publisher, mandatory(_mandatory), immediate(_immediate), redelivered(false), - size(0){ + size(0) {} -} - -Message::~Message(){ -} +Message::~Message(){} void Message::setHeader(AMQHeaderBody::shared_ptr _header){ this->header = _header; @@ -61,7 +57,6 @@ void Message::redeliver(){ void Message::deliver(OutputHandler* out, int channel, const string& consumerTag, u_int64_t deliveryTag, u_int32_t framesize){ - out->send(new AMQFrame(channel, new BasicDeliverBody(consumerTag, deliveryTag, redelivered, exchange, routingKey))); sendContent(out, channel, framesize); } diff --git a/cpp/src/qpid/broker/Message.h b/cpp/src/qpid/broker/Message.h index c4e52db333..b6f41e817a 100644 --- a/cpp/src/qpid/broker/Message.h +++ b/cpp/src/qpid/broker/Message.h @@ -18,7 +18,7 @@ #ifndef _Message_ #define _Message_ -#include "memory.h" +#include <boost/shared_ptr.hpp> #include "qpid/framing/AMQContentBody.h" #include "qpid/framing/AMQHeaderBody.h" #include "qpid/framing/BasicHeaderProperties.h" @@ -53,7 +53,7 @@ namespace qpid { int channel, u_int32_t framesize); public: - typedef std::tr1::shared_ptr<Message> shared_ptr; + typedef boost::shared_ptr<Message> shared_ptr; Message(const ConnectionToken* const publisher, const string& exchange, const string& routingKey, diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h index 8d3e4ab93b..0f20400daa 100644 --- a/cpp/src/qpid/broker/Queue.h +++ b/cpp/src/qpid/broker/Queue.h @@ -20,7 +20,7 @@ #include <vector> #include <queue> -#include "memory.h" +#include <boost/shared_ptr.hpp> #include "apr-1/apr_time.h" #include "qpid/framing/amqp_types.h" #include "qpid/broker/Binding.h" @@ -63,7 +63,7 @@ namespace qpid { public: - typedef std::tr1::shared_ptr<Queue> shared_ptr; + typedef boost::shared_ptr<Queue> shared_ptr; typedef std::vector<shared_ptr> vector; diff --git a/cpp/src/qpid/broker/SessionHandlerImpl.cpp b/cpp/src/qpid/broker/SessionHandlerImpl.cpp index 0713b84164..35f5b20854 100644 --- a/cpp/src/qpid/broker/SessionHandlerImpl.cpp +++ b/cpp/src/qpid/broker/SessionHandlerImpl.cpp @@ -23,7 +23,7 @@ #include "qpid/broker/TopicExchange.h" #include "assert.h" -using namespace std::tr1; +using namespace boost; using namespace qpid::broker; using namespace qpid::io; using namespace qpid::framing; diff --git a/cpp/src/qpid/broker/TopicExchange.cpp b/cpp/src/qpid/broker/TopicExchange.cpp index 6498e7600d..9ab779777c 100644 --- a/cpp/src/qpid/broker/TopicExchange.cpp +++ b/cpp/src/qpid/broker/TopicExchange.cpp @@ -41,14 +41,6 @@ Tokens& Tokens::operator=(const std::string& s) { } return *this; } - -size_t Tokens::Hash::operator()(const Tokens& p) const { - size_t hash = 0; - for (Tokens::const_iterator i = p.begin(); i != p.end(); ++i) { - hash += std::tr1::hash<std::string>()(*i); - } - return hash; -} TopicPattern& TopicPattern::operator=(const Tokens& tokens) { Tokens::operator=(tokens); diff --git a/cpp/src/qpid/broker/TopicExchange.h b/cpp/src/qpid/broker/TopicExchange.h index 29772f5bce..d6c1946e71 100644 --- a/cpp/src/qpid/broker/TopicExchange.h +++ b/cpp/src/qpid/broker/TopicExchange.h @@ -18,7 +18,7 @@ #ifndef _TopicExchange_ #define _TopicExchange_ -#include <tr1/unordered_map> +#include <map> #include <vector> #include "qpid/broker/Exchange.h" #include "qpid/framing/FieldTable.h" @@ -37,13 +37,14 @@ class Tokens : public std::vector<std::string> { /** Tokenize s, provides automatic conversion of string to Tokens */ Tokens(const std::string& s) { operator=(s); } - /** Tokenize s */ + /** Tokenizing assignment operator s */ Tokens & operator=(const std::string& s); - - struct Hash { size_t operator()(const Tokens&) const; }; - typedef std::equal_to<Tokens> Equal; + + private: + size_t hash; }; + /** * Tokens that have been normalized as a pattern and can be matched * with topic Tokens. Normalized meands all sequences of mixed * and @@ -68,7 +69,7 @@ class TopicPattern : public Tokens }; class TopicExchange : public virtual Exchange{ - typedef std::tr1::unordered_map<TopicPattern, Queue::vector, TopicPattern::Hash> BindingMap; + typedef std::map<TopicPattern, Queue::vector> BindingMap; BindingMap bindings; qpid::concurrent::MonitorImpl lock; |
