diff options
| author | Alan Conway <aconway@apache.org> | 2007-04-05 19:16:09 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-04-05 19:16:09 +0000 |
| commit | 6b5c686b366846b7ecb0bb298c41fe474e1fb3c8 (patch) | |
| tree | 33e57b5f764c5d9549b150a43df62da193f735eb /qpid/cpp/src/client/ClientChannel.h | |
| parent | 0370e5550e1d9bc72d742bbbee1f6f0e2835406e (diff) | |
| download | qpid-python-6b5c686b366846b7ecb0bb298c41fe474e1fb3c8.tar.gz | |
* Exteneded use of shared pointers frame bodies across all send() commands.
* tests/Makefile.am: added check-unit target to run just unit tests.
* Introduced make_shared_ptr convenience function for wrapping
plain pointers with shared_ptr.
* cpp/src/client/ClientChannel.h,cpp (sendsendAndReceive,sendAndReceiveSync):
Pass shared_ptr instead of raw ptr to fix memory problems.
Updated the following files to use make_shared_ptr
- src/client/BasicMessageChannel.cpp
- src/client/ClientConnection.cpp
* src/client/MessageMessageChannel.cpp: implemented 0-9 message.get.
* src/framing/Correlator.h,cpp: Allow request sender to register actions
to take when the correlated response arrives.
* cpp/src/tests/FramingTest.cpp: Added Correlator tests.
* src/framing/ChannelAdapter.h,cpp: use Correlator to dispatch
response actions.
* cpp/src/shared_ptr.h (make_shared_ptr): Convenience function
to make a shared pointer from a raw pointer.
* cpp/src/tests/ClientChannelTest.cpp: Added message.get test.
* cpp/src/tests/Makefile.am (check-unit): Added test-unit target
to run unit tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@525932 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/client/ClientChannel.h')
| -rw-r--r-- | qpid/cpp/src/client/ClientChannel.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/qpid/cpp/src/client/ClientChannel.h b/qpid/cpp/src/client/ClientChannel.h index cf2ea1dbe5..328fc23f68 100644 --- a/qpid/cpp/src/client/ClientChannel.h +++ b/qpid/cpp/src/client/ClientChannel.h @@ -56,6 +56,7 @@ class Channel : public framing::ChannelAdapter { private: struct UnknownMethod {}; + typedef shared_ptr<framing::AMQMethodBody> MethodPtr; sys::Mutex lock; boost::scoped_ptr<MessageChannel> messaging; @@ -82,21 +83,23 @@ class Channel : public framing::ChannelAdapter const std::string& vhost); framing::AMQMethodBody::shared_ptr sendAndReceive( - framing::AMQMethodBody*, framing::ClassId, framing::MethodId); + framing::AMQMethodBody::shared_ptr, + framing::ClassId, framing::MethodId); framing::AMQMethodBody::shared_ptr sendAndReceiveSync( bool sync, - framing::AMQMethodBody*, framing::ClassId, framing::MethodId); + framing::AMQMethodBody::shared_ptr, + framing::ClassId, framing::MethodId); template <class BodyType> - boost::shared_ptr<BodyType> sendAndReceive(framing::AMQMethodBody* body) { + boost::shared_ptr<BodyType> sendAndReceive(framing::AMQMethodBody::shared_ptr body) { return boost::shared_polymorphic_downcast<BodyType>( sendAndReceive(body, BodyType::CLASS_ID, BodyType::METHOD_ID)); } template <class BodyType> boost::shared_ptr<BodyType> sendAndReceiveSync( - bool sync, framing::AMQMethodBody* body) { + bool sync, framing::AMQMethodBody::shared_ptr body) { return boost::shared_polymorphic_downcast<BodyType>( sendAndReceiveSync( sync, body, BodyType::CLASS_ID, BodyType::METHOD_ID)); |
