diff options
author | Andrew Stitcher <astitcher@apache.org> | 2010-09-08 16:48:41 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2010-09-08 16:48:41 +0000 |
commit | 4f58af64f169752ea16d3164cbf1320c85a0ea2e (patch) | |
tree | 162ff54d6c184db0c6cbbc1d74dc2472642f7f97 /cpp/src | |
parent | f1ca344c8126bd3bd079897a4e4c3f23affa5203 (diff) | |
download | qpid-python-4f58af64f169752ea16d3164cbf1320c85a0ea2e.tar.gz |
Stop using references to intrusive_ptr in Rdma code
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@995127 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/RdmaConnector.cpp | 16 | ||||
-rw-r--r-- | cpp/src/qpid/sys/RdmaIOPlugin.cpp | 28 | ||||
-rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaIO.h | 12 |
3 files changed, 28 insertions, 28 deletions
diff --git a/cpp/src/qpid/client/RdmaConnector.cpp b/cpp/src/qpid/client/RdmaConnector.cpp index 504c5bd191..56238b2ac7 100644 --- a/cpp/src/qpid/client/RdmaConnector.cpp +++ b/cpp/src/qpid/client/RdmaConnector.cpp @@ -82,10 +82,10 @@ class RdmaConnector : public Connector, public sys::Codec ~RdmaConnector(); // Callbacks - void connected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&); - void connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, Rdma::ErrorType); - void disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&); - void rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&); + void connected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&); + void connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, Rdma::ErrorType); + void disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr); + void rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&); void readbuff(Rdma::AsynchIO&, Rdma::Buffer*); void writebuff(Rdma::AsynchIO&); @@ -188,7 +188,7 @@ void RdmaConnector::connect(const std::string& host, int port){ } // The following only gets run when connected -void RdmaConnector::connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp) { +void RdmaConnector::connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr ci, const Rdma::ConnectionParams& cp) { Rdma::QueuePair::intrusive_ptr q = ci->getQueuePair(); aio = new Rdma::AsynchIO(ci->getQueuePair(), @@ -205,7 +205,7 @@ void RdmaConnector::connected(Poller::shared_ptr poller, Rdma::Connection::intru aio->start(poller); } -void RdmaConnector::connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, Rdma::ErrorType) { +void RdmaConnector::connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, Rdma::ErrorType) { QPID_LOG(debug, "Connection Error " << identifier); { Mutex::ScopedLock l(pollingLock); @@ -216,7 +216,7 @@ void RdmaConnector::connectionError(sys::Poller::shared_ptr, Rdma::Connection::i stopped(); } -void RdmaConnector::disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&) { +void RdmaConnector::disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr) { QPID_LOG(debug, "Connection disconnected " << identifier); { Mutex::ScopedLock l(pollingLock); @@ -227,7 +227,7 @@ void RdmaConnector::disconnected(sys::Poller::shared_ptr, Rdma::Connection::intr drained(); } -void RdmaConnector::rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams& cp) { +void RdmaConnector::rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams& cp) { QPID_LOG(debug, "Connection Rejected " << identifier << ": " << cp.maxRecvBufferSize); { Mutex::ScopedLock l(pollingLock); diff --git a/cpp/src/qpid/sys/RdmaIOPlugin.cpp b/cpp/src/qpid/sys/RdmaIOPlugin.cpp index 044e6b465b..7c2dc77caa 100644 --- a/cpp/src/qpid/sys/RdmaIOPlugin.cpp +++ b/cpp/src/qpid/sys/RdmaIOPlugin.cpp @@ -54,7 +54,7 @@ class RdmaIOHandler : public OutputControl { void write(const framing::ProtocolInitiation&); public: - RdmaIOHandler(Rdma::Connection::intrusive_ptr& c, ConnectionCodec::Factory* f); + RdmaIOHandler(Rdma::Connection::intrusive_ptr c, ConnectionCodec::Factory* f); ~RdmaIOHandler(); void init(Rdma::AsynchIO* a); void start(Poller::shared_ptr poller) {aio->start(poller);} @@ -77,7 +77,7 @@ class RdmaIOHandler : public OutputControl { void drained(Rdma::AsynchIO& aio); }; -RdmaIOHandler::RdmaIOHandler(Rdma::Connection::intrusive_ptr& c, qpid::sys::ConnectionCodec::Factory* f) : +RdmaIOHandler::RdmaIOHandler(Rdma::Connection::intrusive_ptr c, qpid::sys::ConnectionCodec::Factory* f) : connection(c), identifier(c->getPeerName()), factory(f), @@ -223,12 +223,12 @@ class RdmaIOProtocolFactory : public ProtocolFactory { string getHost() const; private: - bool request(Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectionCodec::Factory*); - void established(Poller::shared_ptr, Rdma::Connection::intrusive_ptr&); - void connected(Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectionCodec::Factory*); - void connectionError(Rdma::Connection::intrusive_ptr&, Rdma::ErrorType); - void disconnected(Rdma::Connection::intrusive_ptr&); - void rejected(Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectFailedCallback); + bool request(Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&, ConnectionCodec::Factory*); + void established(Poller::shared_ptr, Rdma::Connection::intrusive_ptr); + void connected(Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&, ConnectionCodec::Factory*); + void connectionError(Rdma::Connection::intrusive_ptr, Rdma::ErrorType); + void disconnected(Rdma::Connection::intrusive_ptr); + void rejected(Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&, ConnectFailedCallback); }; // Static instance to initialise plugin @@ -258,12 +258,12 @@ RdmaIOProtocolFactory::RdmaIOProtocolFactory(int16_t port, int /*backlog*/) : listeningPort(port) {} -void RdmaIOProtocolFactory::established(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci) { +void RdmaIOProtocolFactory::established(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr ci) { RdmaIOHandler* async = ci->getContext<RdmaIOHandler>(); async->start(poller); } -bool RdmaIOProtocolFactory::request(Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp, +bool RdmaIOProtocolFactory::request(Rdma::Connection::intrusive_ptr ci, const Rdma::ConnectionParams& cp, ConnectionCodec::Factory* f) { try { RdmaIOHandler* async = new RdmaIOHandler(ci, f); @@ -289,10 +289,10 @@ bool RdmaIOProtocolFactory::request(Rdma::Connection::intrusive_ptr& ci, const R return false; } -void RdmaIOProtocolFactory::connectionError(Rdma::Connection::intrusive_ptr&, Rdma::ErrorType) { +void RdmaIOProtocolFactory::connectionError(Rdma::Connection::intrusive_ptr, Rdma::ErrorType) { } -void RdmaIOProtocolFactory::disconnected(Rdma::Connection::intrusive_ptr& ci) { +void RdmaIOProtocolFactory::disconnected(Rdma::Connection::intrusive_ptr ci) { // If we've got a connection already tear it down, otherwise ignore RdmaIOHandler* async = ci->getContext<RdmaIOHandler>(); if (async) { @@ -330,12 +330,12 @@ void RdmaIOProtocolFactory::accept(Poller::shared_ptr poller, ConnectionCodec::F } // Only used for outgoing connections (in federation) -void RdmaIOProtocolFactory::rejected(Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectFailedCallback failed) { +void RdmaIOProtocolFactory::rejected(Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&, ConnectFailedCallback failed) { failed(-1, "Connection rejected"); } // Do the same as connection request and established but mark a client too -void RdmaIOProtocolFactory::connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp, +void RdmaIOProtocolFactory::connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr ci, const Rdma::ConnectionParams& cp, ConnectionCodec::Factory* f) { (void) request(ci, cp, f); established(poller, ci); diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.h b/cpp/src/qpid/sys/rdma/RdmaIO.h index aabb330c42..9f55a7be7c 100644 --- a/cpp/src/qpid/sys/rdma/RdmaIO.h +++ b/cpp/src/qpid/sys/rdma/RdmaIO.h @@ -149,8 +149,8 @@ namespace Rdma { UNKNOWN }; - typedef boost::function2<void, Rdma::Connection::intrusive_ptr&, ErrorType> ErrorCallback; - typedef boost::function1<void, Rdma::Connection::intrusive_ptr&> DisconnectedCallback; + typedef boost::function2<void, Rdma::Connection::intrusive_ptr, ErrorType> ErrorCallback; + typedef boost::function1<void, Rdma::Connection::intrusive_ptr> DisconnectedCallback; class ConnectionManager { Connection::intrusive_ptr ci; @@ -177,8 +177,8 @@ namespace Rdma { virtual void connectionEvent(Connection::intrusive_ptr ci) = 0; }; - typedef boost::function2<bool, Rdma::Connection::intrusive_ptr&, const ConnectionParams&> ConnectionRequestCallback; - typedef boost::function1<void, Rdma::Connection::intrusive_ptr&> EstablishedCallback; + typedef boost::function2<bool, Rdma::Connection::intrusive_ptr, const ConnectionParams&> ConnectionRequestCallback; + typedef boost::function1<void, Rdma::Connection::intrusive_ptr> EstablishedCallback; class Listener : public ConnectionManager { @@ -200,8 +200,8 @@ namespace Rdma { void connectionEvent(Connection::intrusive_ptr ci); }; - typedef boost::function2<void, Rdma::Connection::intrusive_ptr&, const ConnectionParams&> RejectedCallback; - typedef boost::function2<void, Rdma::Connection::intrusive_ptr&, const ConnectionParams&> ConnectedCallback; + typedef boost::function2<void, Rdma::Connection::intrusive_ptr, const ConnectionParams&> RejectedCallback; + typedef boost::function2<void, Rdma::Connection::intrusive_ptr, const ConnectionParams&> ConnectedCallback; class Connector : public ConnectionManager { |