diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-05-18 22:05:11 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-05-18 22:05:11 +0000 |
| commit | 351b9822649f305fc270c30e3c6db6b81761d984 (patch) | |
| tree | 1722b7387e95bea1b9c116f928b1df5ddc0fe0ef /qpid/cpp | |
| parent | 7e7443f59a66fbeb92aa44da48317697129e9289 (diff) | |
| download | qpid-python-351b9822649f305fc270c30e3c6db6b81761d984.tar.gz | |
QPID-4005: Eliminate "using" especially "using namespace" from header file
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1340276 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/include/qpid/Options.h | 9 | ||||
| -rw-r--r-- | qpid/cpp/include/qpid/client/SessionBase_0_10.h | 13 | ||||
| -rw-r--r-- | qpid/cpp/include/qpid/client/SubscriptionSettings.h | 14 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/ReplicationTest.cpp | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/txjob.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/txshift.cpp | 2 |
6 files changed, 29 insertions, 19 deletions
diff --git a/qpid/cpp/include/qpid/Options.h b/qpid/cpp/include/qpid/Options.h index 9860076195..0bbe7b704f 100644 --- a/qpid/cpp/include/qpid/Options.h +++ b/qpid/cpp/include/qpid/Options.h @@ -81,13 +81,12 @@ po::value_semantic* optValue(T& value, const char* name) { */ template <class T> po::value_semantic* optValue(std::vector<T>& value, const char* name) { - using namespace std; - ostringstream os; - copy(value.begin(), value.end(), ostream_iterator<T>(os, " ")); - string val=os.str(); + std::ostringstream os; + std::copy(value.begin(), value.end(), std::ostream_iterator<T>(os, " ")); + std::string val=os.str(); if (!val.empty()) val.erase(val.end()-1); // Remove trailing " " - return (new OptionValue<vector<T> >(value, prettyArg(name, val))); + return (new OptionValue<std::vector<T> >(value, prettyArg(name, val))); } /** Create a boolean switch value. Presence of the option sets the value. */ diff --git a/qpid/cpp/include/qpid/client/SessionBase_0_10.h b/qpid/cpp/include/qpid/client/SessionBase_0_10.h index ea50ab32f7..630987c11d 100644 --- a/qpid/cpp/include/qpid/client/SessionBase_0_10.h +++ b/qpid/cpp/include/qpid/client/SessionBase_0_10.h @@ -36,14 +36,13 @@ namespace client { class Connection; class SessionImpl; -using std::string; -using framing::Content; -using framing::FieldTable; -using framing::SequenceNumber; -using framing::SequenceSet; -using framing::SequenceNumberSet; +using qpid::framing::Content; +using qpid::framing::FieldTable; +using qpid::framing::SequenceNumber; +using qpid::framing::SequenceSet; +using qpid::framing::SequenceNumberSet; using qpid::SessionId; -using framing::Xid; +using qpid::framing::Xid; /** Unit of message credit: messages or bytes */ enum CreditUnit { MESSAGE_CREDIT=0, BYTE_CREDIT=1, UNLIMITED_CREDIT=0xFFFFFFFF }; diff --git a/qpid/cpp/include/qpid/client/SubscriptionSettings.h b/qpid/cpp/include/qpid/client/SubscriptionSettings.h index b4cb302b56..bee39f6816 100644 --- a/qpid/cpp/include/qpid/client/SubscriptionSettings.h +++ b/qpid/cpp/include/qpid/client/SubscriptionSettings.h @@ -28,7 +28,19 @@ namespace qpid { namespace client { /** Bring AMQP enum definitions for message class into this namespace. */ -using namespace qpid::framing::message; +using qpid::framing::message::AcceptMode; +using qpid::framing::message::AcquireMode; +using qpid::framing::message::ACCEPT_MODE_EXPLICIT; +using qpid::framing::message::ACCEPT_MODE_NONE; +using qpid::framing::message::ACQUIRE_MODE_NOT_ACQUIRED; +using qpid::framing::message::ACQUIRE_MODE_PRE_ACQUIRED; +using qpid::framing::message::CREDIT_UNIT_BYTE; +using qpid::framing::message::CREDIT_UNIT_MESSAGE; +using qpid::framing::message::DELIVERY_MODE_NON_PERSISTENT; +using qpid::framing::message::DELIVERY_MODE_PERSISTENT; +using qpid::framing::message::FLOW_MODE_CREDIT; +using qpid::framing::message::FLOW_MODE_WINDOW; + enum CompletionMode { MANUAL_COMPLETION = 0, diff --git a/qpid/cpp/src/tests/ReplicationTest.cpp b/qpid/cpp/src/tests/ReplicationTest.cpp index 1219a6b59e..055f06579f 100644 --- a/qpid/cpp/src/tests/ReplicationTest.cpp +++ b/qpid/cpp/src/tests/ReplicationTest.cpp @@ -62,7 +62,7 @@ qpid::sys::Shlib plugin(getLibPath("REPLICATING_LISTENER_LIB", default_shlib)); qpid::broker::Broker::Options getBrokerOpts(const std::vector<std::string>& args) { std::vector<const char*> argv(args.size()); - transform(args.begin(), args.end(), argv.begin(), boost::bind(&string::c_str, _1)); + transform(args.begin(), args.end(), argv.begin(), boost::bind(&std::string::c_str, _1)); qpid::broker::Broker::Options opts; qpid::Plugin::addOptions(opts); @@ -72,7 +72,7 @@ qpid::broker::Broker::Options getBrokerOpts(const std::vector<std::string>& args QPID_AUTO_TEST_CASE(testReplicationExchange) { - qpid::broker::Broker::Options brokerOpts(getBrokerOpts(list_of<string>("qpidd") + qpid::broker::Broker::Options brokerOpts(getBrokerOpts(list_of<std::string>("qpidd") ("--replication-exchange-name=qpid.replication"))); SessionFixture f(brokerOpts); diff --git a/qpid/cpp/src/tests/txjob.cpp b/qpid/cpp/src/tests/txjob.cpp index a7a905c1b7..29394c3415 100644 --- a/qpid/cpp/src/tests/txjob.cpp +++ b/qpid/cpp/src/tests/txjob.cpp @@ -38,9 +38,9 @@ namespace tests { struct Args : public qpid::TestOptions { - string workQueue; - string source; - string dest; + std::string workQueue; + std::string source; + std::string dest; uint messages; uint jobs; bool quit; diff --git a/qpid/cpp/src/tests/txshift.cpp b/qpid/cpp/src/tests/txshift.cpp index 882d3716d8..bf85bee986 100644 --- a/qpid/cpp/src/tests/txshift.cpp +++ b/qpid/cpp/src/tests/txshift.cpp @@ -39,7 +39,7 @@ namespace tests { struct Args : public qpid::TestOptions { - string workQueue; + std::string workQueue; size_t workers; Args() : workQueue("txshift-control"), workers(1) |
