diff options
author | Gordon Sim <gsim@apache.org> | 2006-11-22 16:18:06 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2006-11-22 16:18:06 +0000 |
commit | f6b81bf19f1e9c5a6299516f030623bd41a73e56 (patch) | |
tree | 50ad4b3e91738c87d18a5e28eebf40e249f5f8df | |
parent | 6e1582a62b461e389a7b65ca0053e3cc52f3dc27 (diff) | |
download | qpid-python-f6b81bf19f1e9c5a6299516f030623bd41a73e56.tar.gz |
Enclose any 'using std::string' statements within qpid namespaces to avoid pollution of global namespaces.
Explicit use of std::string in many places, especially for client APIs where not already done.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@478212 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/broker/Channel.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/DeliveryRecord.cpp | 1 | ||||
-rw-r--r-- | cpp/src/qpid/broker/DeliveryRecord.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Exchange.h | 10 | ||||
-rw-r--r-- | cpp/src/qpid/broker/ExchangeRegistry.h | 8 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Message.h | 3 | ||||
-rw-r--r-- | cpp/src/qpid/broker/MessageStore.h | 8 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Queue.h | 1 | ||||
-rw-r--r-- | cpp/src/qpid/broker/RecoveryManager.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/TxPublish.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/client/Channel.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/Connection.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/client/IncomingMessage.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/client/Message.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/framing/amqp_types.h | 7 | ||||
-rw-r--r-- | cpp/test/client/client_test.cpp | 1 | ||||
-rw-r--r-- | cpp/test/client/echo_service.cpp | 1 | ||||
-rw-r--r-- | cpp/test/client/topic_listener.cpp | 1 | ||||
-rw-r--r-- | cpp/test/client/topic_publisher.cpp | 1 |
19 files changed, 43 insertions, 25 deletions
diff --git a/cpp/src/qpid/broker/Channel.h b/cpp/src/qpid/broker/Channel.h index 0baf90edbb..6ed867284c 100644 --- a/cpp/src/qpid/broker/Channel.h +++ b/cpp/src/qpid/broker/Channel.h @@ -48,6 +48,8 @@ namespace qpid { namespace broker { + using qpid::framing::string; + /** * Maintains state for an AMQP channel. Handles incoming and * outgoing messages for that channel. diff --git a/cpp/src/qpid/broker/DeliveryRecord.cpp b/cpp/src/qpid/broker/DeliveryRecord.cpp index a1efc17d19..0e4e8c4336 100644 --- a/cpp/src/qpid/broker/DeliveryRecord.cpp +++ b/cpp/src/qpid/broker/DeliveryRecord.cpp @@ -22,6 +22,7 @@ #include <qpid/broker/Channel.h> using namespace qpid::broker; +using std::string; DeliveryRecord::DeliveryRecord(Message::shared_ptr _msg, Queue::shared_ptr _queue, diff --git a/cpp/src/qpid/broker/DeliveryRecord.h b/cpp/src/qpid/broker/DeliveryRecord.h index a7fe53cee5..4c4e4f0224 100644 --- a/cpp/src/qpid/broker/DeliveryRecord.h +++ b/cpp/src/qpid/broker/DeliveryRecord.h @@ -38,12 +38,12 @@ namespace qpid { class DeliveryRecord{ mutable Message::shared_ptr msg; mutable Queue::shared_ptr queue; - string consumerTag; + std::string consumerTag; u_int64_t deliveryTag; bool pull; public: - DeliveryRecord(Message::shared_ptr msg, Queue::shared_ptr queue, const string consumerTag, const u_int64_t deliveryTag); + DeliveryRecord(Message::shared_ptr msg, Queue::shared_ptr queue, const std::string consumerTag, const u_int64_t deliveryTag); DeliveryRecord(Message::shared_ptr msg, Queue::shared_ptr queue, const u_int64_t deliveryTag); void discard(TransactionContext* ctxt = 0) const; diff --git a/cpp/src/qpid/broker/Exchange.h b/cpp/src/qpid/broker/Exchange.h index a89ea25daa..2cca942290 100644 --- a/cpp/src/qpid/broker/Exchange.h +++ b/cpp/src/qpid/broker/Exchange.h @@ -28,15 +28,17 @@ namespace qpid { namespace broker { + using std::string; + class Exchange{ - const std::string name; + const string name; public: typedef boost::shared_ptr<Exchange> shared_ptr; - explicit Exchange(const std::string& _name) : name(_name){} + explicit Exchange(const string& _name) : name(_name){} virtual ~Exchange(){} - std::string getName() { return name; } - virtual std::string getType() = 0; + string getName() { return name; } + virtual string getType() = 0; virtual void bind(Queue::shared_ptr queue, const string& routingKey, qpid::framing::FieldTable* args) = 0; virtual void unbind(Queue::shared_ptr queue, const string& routingKey, qpid::framing::FieldTable* args) = 0; virtual void route(Deliverable& msg, const string& routingKey, qpid::framing::FieldTable* args) = 0; diff --git a/cpp/src/qpid/broker/ExchangeRegistry.h b/cpp/src/qpid/broker/ExchangeRegistry.h index 7090f66ebd..5c4da7c917 100644 --- a/cpp/src/qpid/broker/ExchangeRegistry.h +++ b/cpp/src/qpid/broker/ExchangeRegistry.h @@ -30,13 +30,13 @@ namespace broker { struct UnknownExchangeTypeException{}; class ExchangeRegistry{ - typedef std::map<string, Exchange::shared_ptr> ExchangeMap; + typedef std::map<std::string, Exchange::shared_ptr> ExchangeMap; ExchangeMap exchanges; qpid::sys::Mutex lock; public: - std::pair<Exchange::shared_ptr, bool> declare(const string& name, const string& type) throw(UnknownExchangeTypeException); - void destroy(const string& name); - Exchange::shared_ptr get(const string& name); + std::pair<Exchange::shared_ptr, bool> declare(const std::string& name, const std::string& type) throw(UnknownExchangeTypeException); + void destroy(const std::string& name); + Exchange::shared_ptr get(const std::string& name); Exchange::shared_ptr getDefault(); }; } diff --git a/cpp/src/qpid/broker/Message.h b/cpp/src/qpid/broker/Message.h index bfdfcf69d5..f6b9e19209 100644 --- a/cpp/src/qpid/broker/Message.h +++ b/cpp/src/qpid/broker/Message.h @@ -32,7 +32,8 @@ namespace qpid { namespace broker { - + + using qpid::framing::string; /** * Represents an AMQP message, i.e. a header body, a list of * content bodies and some details about the publication diff --git a/cpp/src/qpid/broker/MessageStore.h b/cpp/src/qpid/broker/MessageStore.h index 3acada0f82..13b5ba1152 100644 --- a/cpp/src/qpid/broker/MessageStore.h +++ b/cpp/src/qpid/broker/MessageStore.h @@ -57,7 +57,7 @@ namespace qpid { * distributed transaction in which the operation takes * place or null for 'local' transactions */ - virtual void enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const Queue& queue, const string * const xid) = 0; + virtual void enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const Queue& queue, const std::string * const xid) = 0; /** * Dequeues a message, recording that the given message is * no longer on the given queue and deleting the message @@ -69,15 +69,15 @@ namespace qpid { * distributed transaction in which the operation takes * place or null for 'local' transactions */ - virtual void dequeue(TransactionContext* ctxt, Message::shared_ptr& msg, const Queue& queue, const string * const xid) = 0; + virtual void dequeue(TransactionContext* ctxt, Message::shared_ptr& msg, const Queue& queue, const std::string * const xid) = 0; /** * Treat all enqueue/dequeues where this xid was specified as being committed. */ - virtual void committed(const string * const xid) = 0; + virtual void committed(const std::string * const xid) = 0; /** * Treat all enqueue/dequeues where this xid was specified as being aborted. */ - virtual void aborted(const string * const xid) = 0; + virtual void aborted(const std::string * const xid) = 0; virtual ~MessageStore(){} }; diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h index 7c90ccdbad..0c67540dac 100644 --- a/cpp/src/qpid/broker/Queue.h +++ b/cpp/src/qpid/broker/Queue.h @@ -40,6 +40,7 @@ namespace qpid { */ struct ExclusiveAccessException{}; + using std::string; /** * The brokers representation of an amqp queue. Messages are * delivered to a queue from where they can be dispatched to diff --git a/cpp/src/qpid/broker/RecoveryManager.h b/cpp/src/qpid/broker/RecoveryManager.h index 64fb11fe11..6df5af687c 100644 --- a/cpp/src/qpid/broker/RecoveryManager.h +++ b/cpp/src/qpid/broker/RecoveryManager.h @@ -33,8 +33,8 @@ namespace broker { public: RecoveryManager(QueueRegistry& queues, ExchangeRegistry& exchanges); ~RecoveryManager(); - Queue::shared_ptr recoverQueue(const string& name); - Exchange::shared_ptr recoverExchange(const string& name, const string& type); + Queue::shared_ptr recoverQueue(const std::string& name); + Exchange::shared_ptr recoverExchange(const std::string& name, const std::string& type); }; diff --git a/cpp/src/qpid/broker/TxPublish.h b/cpp/src/qpid/broker/TxPublish.h index dd2a9be7e7..c375bd0f94 100644 --- a/cpp/src/qpid/broker/TxPublish.h +++ b/cpp/src/qpid/broker/TxPublish.h @@ -46,9 +46,9 @@ namespace qpid { class Prepare{ TransactionContext* ctxt; Message::shared_ptr& msg; - const string* const xid; + const std::string* const xid; public: - Prepare(TransactionContext* ctxt, Message::shared_ptr& msg, const string* const xid); + Prepare(TransactionContext* ctxt, Message::shared_ptr& msg, const std::string* const xid); void operator()(Queue::shared_ptr& queue); }; diff --git a/cpp/src/qpid/client/Channel.h b/cpp/src/qpid/client/Channel.h index ca32e7ea4d..b2e08f5756 100644 --- a/cpp/src/qpid/client/Channel.h +++ b/cpp/src/qpid/client/Channel.h @@ -47,7 +47,7 @@ namespace client { int count; u_int64_t lastDeliveryTag; }; - typedef std::map<string,Consumer*>::iterator consumer_iterator; + typedef std::map<std::string,Consumer*>::iterator consumer_iterator; u_int16_t id; Connection* con; diff --git a/cpp/src/qpid/client/Connection.h b/cpp/src/qpid/client/Connection.h index edb7e0e974..340ebe9a0f 100644 --- a/cpp/src/qpid/client/Connection.h +++ b/cpp/src/qpid/client/Connection.h @@ -61,8 +61,8 @@ class Connection : public virtual qpid::framing::InputHandler, volatile bool closed; void channelException(Channel* channel, qpid::framing::AMQMethodBody* body, QpidError& e); - void error(int code, const string& msg, int classid = 0, int methodid = 0); - void closeChannel(Channel* channel, u_int16_t code, string& text, u_int16_t classId = 0, u_int16_t methodId = 0); + void error(int code, const std::string& msg, int classid = 0, int methodid = 0); + void closeChannel(Channel* channel, u_int16_t code, std::string& text, u_int16_t classId = 0, u_int16_t methodId = 0); void sendAndReceive(qpid::framing::AMQFrame* frame, const qpid::framing::AMQMethodBody& body); virtual void handleMethod(qpid::framing::AMQMethodBody::shared_ptr body); diff --git a/cpp/src/qpid/client/IncomingMessage.h b/cpp/src/qpid/client/IncomingMessage.h index 352fa9a025..b72c78575e 100644 --- a/cpp/src/qpid/client/IncomingMessage.h +++ b/cpp/src/qpid/client/IncomingMessage.h @@ -50,10 +50,10 @@ namespace client { bool isReturn(); bool isDelivery(); bool isResponse(); - const string& getConsumerTag();//only relevant if isDelivery() + const std::string& getConsumerTag();//only relevant if isDelivery() qpid::framing::AMQHeaderBody::shared_ptr& getHeader(); u_int64_t getDeliveryTag(); - void getData(string& data); + void getData(std::string& data); }; } diff --git a/cpp/src/qpid/client/Message.h b/cpp/src/qpid/client/Message.h index 05667ae221..28e6adc608 100644 --- a/cpp/src/qpid/client/Message.h +++ b/cpp/src/qpid/client/Message.h @@ -30,7 +30,7 @@ namespace client { class Message{ qpid::framing::AMQHeaderBody::shared_ptr header; - string data; + std::string data; bool redelivered; u_int64_t deliveryTag; diff --git a/cpp/src/qpid/framing/amqp_types.h b/cpp/src/qpid/framing/amqp_types.h index a4725dcbc5..3d8e9632c0 100644 --- a/cpp/src/qpid/framing/amqp_types.h +++ b/cpp/src/qpid/framing/amqp_types.h @@ -33,6 +33,13 @@ typedef unsigned __int64 u_int64_t; #ifndef AMQP_TYPES_H #define AMQP_TYPES_H +namespace qpid +{ +namespace framing +{ + using std::string; +} +} #endif diff --git a/cpp/test/client/client_test.cpp b/cpp/test/client/client_test.cpp index f9eca39bfe..18b162ec8a 100644 --- a/cpp/test/client/client_test.cpp +++ b/cpp/test/client/client_test.cpp @@ -30,6 +30,7 @@ using namespace qpid::client; using namespace qpid::sys; +using std::string; class SimpleListener : public virtual MessageListener{ Monitor* monitor; diff --git a/cpp/test/client/echo_service.cpp b/cpp/test/client/echo_service.cpp index 9d10610c83..f0aa49fd4b 100644 --- a/cpp/test/client/echo_service.cpp +++ b/cpp/test/client/echo_service.cpp @@ -30,6 +30,7 @@ using namespace qpid::client; using namespace qpid::sys; +using std::string; class EchoServer : public MessageListener{ Channel* const channel; diff --git a/cpp/test/client/topic_listener.cpp b/cpp/test/client/topic_listener.cpp index 3cc4cf4a15..413d482361 100644 --- a/cpp/test/client/topic_listener.cpp +++ b/cpp/test/client/topic_listener.cpp @@ -30,6 +30,7 @@ using namespace qpid::client; using namespace qpid::sys; +using std::string; class Listener : public MessageListener{ Channel* const channel; diff --git a/cpp/test/client/topic_publisher.cpp b/cpp/test/client/topic_publisher.cpp index e6abdeca5b..d9f271e2f0 100644 --- a/cpp/test/client/topic_publisher.cpp +++ b/cpp/test/client/topic_publisher.cpp @@ -32,6 +32,7 @@ using namespace qpid::client; using namespace qpid::sys; +using std::string; class Publisher : public MessageListener{ Channel* const channel; |