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 | bb79efff2408de5f6cd66089cde8b8a82cc80cc2 (patch) | |
tree | 9d9c72158da31cebdd7ee538a11951b240922065 /cpp/src/client/BasicMessageChannel.cpp | |
parent | 2a1e4c9663ff0725c061248a96ebab763678fdd6 (diff) | |
download | qpid-python-bb79efff2408de5f6cd66089cde8b8a82cc80cc2.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/qpid@525932 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/client/BasicMessageChannel.cpp')
-rw-r--r-- | cpp/src/client/BasicMessageChannel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cpp/src/client/BasicMessageChannel.cpp b/cpp/src/client/BasicMessageChannel.cpp index 9e3d184673..c577c0a305 100644 --- a/cpp/src/client/BasicMessageChannel.cpp +++ b/cpp/src/client/BasicMessageChannel.cpp @@ -81,10 +81,10 @@ void BasicMessageChannel::consume( BasicConsumeOkBody::shared_ptr ok = channel.sendAndReceiveSync<BasicConsumeOkBody>( synch, - new BasicConsumeBody( + make_shared_ptr(new BasicConsumeBody( channel.version, 0, queue.getName(), tag, noLocal, ackMode == NO_ACK, false, !synch, - fields ? *fields : FieldTable())); + fields ? *fields : FieldTable()))); tag = ok->getConsumerTag(); } @@ -102,7 +102,7 @@ void BasicMessageChannel::cancel(const std::string& tag, bool synch) { if(c.ackMode == LAZY_ACK && c.lastDeliveryTag > 0) channel.send(new BasicAckBody(channel.version, c.lastDeliveryTag, true)); channel.sendAndReceiveSync<BasicCancelOkBody>( - synch, new BasicCancelBody(channel.version, tag, !synch)); + synch, make_shared_ptr(new BasicCancelBody(channel.version, tag, !synch))); } void BasicMessageChannel::close(){ @@ -337,9 +337,9 @@ void BasicMessageChannel::setReturnedMessageHandler(ReturnedMessageHandler* hand void BasicMessageChannel::setQos(){ channel.sendAndReceive<BasicQosOkBody>( - new BasicQosBody(channel.version, 0, channel.getPrefetch(), false)); + make_shared_ptr(new BasicQosBody(channel.version, 0, channel.getPrefetch(), false))); if(channel.isTransactional()) - channel.sendAndReceive<TxSelectOkBody>(new TxSelectBody(channel.version)); + channel.sendAndReceive<TxSelectOkBody>(make_shared_ptr(new TxSelectBody(channel.version))); } }} // namespace qpid::client |