qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r680827 - in /incubator/qpid/trunk/qpid/cpp/src: qpid/broker/DtxWorkRecord.cpp qpid/broker/Queue.cpp qpid/broker/SessionAdapter.cpp qpid/broker/TopicExchange.cpp qpid/broker/TxBuffer.cpp qpid/framing/FrameSet.h tests/ClientSessionTest.cpp
Date Tue, 29 Jul 2008 20:26:33 GMT
Author: astitcher
Date: Tue Jul 29 13:26:32 2008
New Revision: 680827

URL: http://svn.apache.org/viewvc?rev=680827&view=rev
Log:
QPID-1198 (Partial): Added explicit namespaces that the Sun C++ requires (that gcc doesn't)
Patches from Manuel Teira.
It's not clear at this point whether there is a compiler problem with gcc that it does find
the symbols in the namespaces or SunCC that it doesn't!

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TxBuffer.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h
    incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp Tue Jul 29 13:26:32 2008
@@ -79,7 +79,7 @@
             store->commit(*txn);
             txn.reset();
             
-            for_each(work.begin(), work.end(), mem_fn(&TxBuffer::commit));
+            std::for_each(work.begin(), work.end(), mem_fn(&TxBuffer::commit));
             return true;
         } else {
             //1pc commit optimisation, don't need a 2pc transaction context:
@@ -89,7 +89,7 @@
             std::auto_ptr<TransactionContext> localtxn = store->begin();
             if (prepare(localtxn.get())) {
                 store->commit(*localtxn);
-                for_each(work.begin(), work.end(), mem_fn(&TxBuffer::commit));
+                std::for_each(work.begin(), work.end(), mem_fn(&TxBuffer::commit));
                 return true;
             } else {
                 store->abort(*localtxn);
@@ -149,7 +149,7 @@
         store->abort(*txn);
         txn.reset();
     }
-    for_each(work.begin(), work.end(), mem_fn(&TxBuffer::rollback));
+    std::for_each(work.begin(), work.end(), mem_fn(&TxBuffer::rollback));
 }
 
 void DtxWorkRecord::recover(std::auto_ptr<TPCTransactionContext> _txn, DtxBuffer::shared_ptr
ops)

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Tue Jul 29 13:26:32 2008
@@ -292,13 +292,13 @@
 {
     Mutex::ScopedLock locker(messageLock);
     notifierLock.wait(messageLock);//wait until no notifies are in progress 
-    Listeners::iterator i = find(listeners.begin(), listeners.end(), &c);
+    Listeners::iterator i = std::find(listeners.begin(), listeners.end(), &c);
     if (i != listeners.end()) listeners.erase(i);
 }
 
 void Queue::addListener(Consumer& c)
 {
-    Listeners::iterator i = find(listeners.begin(), listeners.end(), &c);
+    Listeners::iterator i = std::find(listeners.begin(), listeners.end(), &c);
     if (i == listeners.end()) listeners.push_back(&c);
 }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp Tue Jul 29 13:26:32 2008
@@ -302,7 +302,7 @@
     }else{
         //remove the queue from the list of exclusive queues if necessary
         if(q->isExclusiveOwner(&getConnection())){
-            QueueVector::iterator i = find(getConnection().exclusiveQueues.begin(), getConnection().exclusiveQueues.end(),
q);
+            QueueVector::iterator i = std::find(getConnection().exclusiveQueues.begin(),
getConnection().exclusiveQueues.end(), q);
             if(i < getConnection().exclusiveQueues.end()) getConnection().exclusiveQueues.erase(i);
         }
         q->destroy();

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp Tue Jul 29 13:26:32 2008
@@ -36,7 +36,7 @@
     std::string::const_iterator i = s.begin();
     while (true) {
         // Invariant: i is at the beginning of the next untokenized word.
-        std::string::const_iterator j = find(i, s.end(), '.');
+        std::string::const_iterator j = std::find(i, s.end(), '.');
         push_back(std::string(i, j));
         if (j == s.end()) return *this;
         i = j + 1;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TxBuffer.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TxBuffer.cpp?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TxBuffer.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TxBuffer.cpp Tue Jul 29 13:26:32 2008
@@ -37,13 +37,13 @@
 
 void TxBuffer::commit()
 {
-    for_each(ops.begin(), ops.end(), mem_fn(&TxOp::commit));
+    std::for_each(ops.begin(), ops.end(), mem_fn(&TxOp::commit));
     ops.clear();
 }
 
 void TxBuffer::rollback()
 {
-    for_each(ops.begin(), ops.end(), mem_fn(&TxOp::rollback));
+    std::for_each(ops.begin(), ops.end(), mem_fn(&TxOp::rollback));
     ops.clear();
 }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h Tue Jul 29 13:26:32 2008
@@ -76,15 +76,15 @@
     const SequenceNumber& getId() const { return id; }
 
     template <class P> void remove(P predicate) {
-        parts.erase(remove_if(parts.begin(), parts.end(), predicate), parts.end());
+        parts.erase(std::remove_if(parts.begin(), parts.end(), predicate), parts.end());
     }
 
     template <class F> void map(F& functor) {
-        for_each(parts.begin(), parts.end(), functor);
+        std::for_each(parts.begin(), parts.end(), functor);
     }
 
     template <class F> void map(F& functor) const {
-        for_each(parts.begin(), parts.end(), functor);
+        std::for_each(parts.begin(), parts.end(), functor);
     }
 
     template <class F, class P> void map_if(F& functor, P predicate) {

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp?rev=680827&r1=680826&r2=680827&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp Tue Jul 29 13:26:32 2008
@@ -37,7 +37,6 @@
 QPID_AUTO_TEST_SUITE(ClientSessionTest)
 
 using namespace qpid::client;
-using namespace qpid::client::arg;
 using namespace qpid::framing;
 using namespace qpid;
 using qpid::sys::Monitor;
@@ -46,7 +45,6 @@
 using std::string;
 using std::cout;
 using std::endl;
-using namespace boost;
 
 
 struct DummyListener : public sys::Runnable, public MessageListener {
@@ -99,17 +97,17 @@
     void declareSubscribe(const string& q="my-queue",
                           const string& dest="my-dest")
     {
-        session.queueDeclare(queue=q);
-        session.messageSubscribe(queue=q, destination=dest, acquireMode=1);
-        session.messageFlow(destination=dest, unit=0, value=0xFFFFFFFF);//messages
-        session.messageFlow(destination=dest, unit=1, value=0xFFFFFFFF);//bytes
+        session.queueDeclare(arg::queue=q);
+        session.messageSubscribe(arg::queue=q, arg::destination=dest, arg::acquireMode=1);
+        session.messageFlow(arg::destination=dest, arg::unit=0, arg::value=0xFFFFFFFF);//messages
+        session.messageFlow(arg::destination=dest, arg::unit=1, arg::value=0xFFFFFFFF);//bytes
     }
 };
 
 QPID_AUTO_TEST_CASE(testQueueQuery) {
     ClientSessionFixture fix;
     fix.session = fix.connection.newSession();
-    fix.session.queueDeclare(queue="my-queue", alternateExchange="amq.fanout", exclusive=true,
autoDelete=true);
+    fix.session.queueDeclare(arg::queue="my-queue", arg::alternateExchange="amq.fanout",
arg::exclusive=true, arg::autoDelete=true);
     QueueQueryResult result = fix.session.queueQuery(string("my-queue"));
     BOOST_CHECK_EQUAL(false, result.getDurable());
     BOOST_CHECK_EQUAL(true, result.getExclusive());
@@ -122,7 +120,7 @@
     ClientSessionFixture fix;
     fix.session=fix.connection.newSession();
     fix.declareSubscribe();
-    fix.session.messageTransfer(acceptMode=1, content=TransferContent("my-message", "my-queue"));
+    fix.session.messageTransfer(arg::acceptMode=1, arg::content=TransferContent("my-message",
"my-queue"));
     //get & test the message:
     FrameSet::shared_ptr msg = fix.session.get();
     BOOST_CHECK(msg->isA<MessageTransferBody>());
@@ -139,12 +137,12 @@
     fix.declareSubscribe();
     size_t count = 100;
     for (size_t i = 0; i < count; ++i) 
-        fix.session.messageTransfer(content=TransferContent(lexical_cast<string>(i),
"my-queue"));
+        fix.session.messageTransfer(arg::content=TransferContent(boost::lexical_cast<string>(i),
"my-queue"));
     DummyListener listener(fix.session, "my-dest", count);
     listener.run();
     BOOST_CHECK_EQUAL(count, listener.messages.size());        
     for (size_t i = 0; i < count; ++i) 
-        BOOST_CHECK_EQUAL(lexical_cast<string>(i), listener.messages[i].getData());
+        BOOST_CHECK_EQUAL(boost::lexical_cast<string>(i), listener.messages[i].getData());
 }
 
 QPID_AUTO_TEST_CASE(testDispatcherThread)
@@ -156,12 +154,12 @@
     DummyListener listener(fix.session, "my-dest", count);
     sys::Thread t(listener);
     for (size_t i = 0; i < count; ++i) {
-        fix.session.messageTransfer(content=TransferContent(lexical_cast<string>(i),
"my-queue"));
+        fix.session.messageTransfer(arg::content=TransferContent(boost::lexical_cast<string>(i),
"my-queue"));
     }
     t.join();
     BOOST_CHECK_EQUAL(count, listener.messages.size());        
     for (size_t i = 0; i < count; ++i) 
-        BOOST_CHECK_EQUAL(lexical_cast<string>(i), listener.messages[i].getData());
+        BOOST_CHECK_EQUAL(boost::lexical_cast<string>(i), listener.messages[i].getData());
 }
 
 // FIXME aconway 2008-05-26: Re-enable with final resume implementation.
@@ -204,14 +202,14 @@
 QPID_AUTO_TEST_CASE(testSendToSelf) {
     ClientSessionFixture fix;
     SimpleListener mylistener;
-    fix.session.queueDeclare(queue="myq", exclusive=true, autoDelete=true);
+    fix.session.queueDeclare(arg::queue="myq", arg::exclusive=true, arg::autoDelete=true);
     fix.subs.subscribe(mylistener, "myq");
     sys::Thread runner(fix.subs);//start dispatcher thread
     string data("msg");
     Message msg(data, "myq");
     const uint count=10;
     for (uint i = 0; i < count; ++i) {
-        fix.session.messageTransfer(content=msg);
+        fix.session.messageTransfer(arg::content=msg);
     }
     mylistener.waitFor(count);
     fix.subs.cancel("myq");
@@ -226,12 +224,12 @@
 
 QPID_AUTO_TEST_CASE(testLocalQueue) {
     ClientSessionFixture fix;
-    fix.session.queueDeclare(queue="lq", exclusive=true, autoDelete=true);
+    fix.session.queueDeclare(arg::queue="lq", arg::exclusive=true, arg::autoDelete=true);
     LocalQueue lq;
     fix.subs.subscribe(lq, "lq", FlowControl(2, FlowControl::UNLIMITED, false));
-    fix.session.messageTransfer(content=Message("foo0", "lq"));
-    fix.session.messageTransfer(content=Message("foo1", "lq"));
-    fix.session.messageTransfer(content=Message("foo2", "lq"));
+    fix.session.messageTransfer(arg::content=Message("foo0", "lq"));
+    fix.session.messageTransfer(arg::content=Message("foo1", "lq"));
+    fix.session.messageTransfer(arg::content=Message("foo2", "lq"));
     BOOST_CHECK_EQUAL("foo0", lq.pop().getData());
     BOOST_CHECK_EQUAL("foo1", lq.pop().getData());
     BOOST_CHECK(lq.empty());    // Credit exhausted.
@@ -248,15 +246,15 @@
     void run()
     {
         sleep(1);
-        fixture.session.messageTransfer(content=Message("foo2", "getq"));
+        fixture.session.messageTransfer(arg::content=Message("foo2", "getq"));
     }
 };
 
 QPID_AUTO_TEST_CASE(testGet) {
     ClientSessionFixture fix;
-    fix.session.queueDeclare(queue="getq", exclusive=true, autoDelete=true);
-    fix.session.messageTransfer(content=Message("foo0", "getq"));
-    fix.session.messageTransfer(content=Message("foo1", "getq"));
+    fix.session.queueDeclare(arg::queue="getq", arg::exclusive=true, arg::autoDelete=true);
+    fix.session.messageTransfer(arg::content=Message("foo0", "getq"));
+    fix.session.messageTransfer(arg::content=Message("foo1", "getq"));
     Message got;
     BOOST_CHECK(fix.subs.get(got, "getq", TIME_SEC));
     BOOST_CHECK_EQUAL("foo0", got.getData());



Mime
View raw message