From 0efcf2c5c91f4927ccc00ad1cf391c2f964cc2e1 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 27 Jun 2007 21:19:14 +0000 Subject: * src/qpid/framing/ChannelAdapter.cpp: Use handler chains for in and outbound frames. * src/qpid/framing/InputHandler.h, OutputHandler.h, FrameHandler.h: All handlers pass AMQFrame& and have consistent memory management. Terminal OutputHandlers used to take ownership and delete frame, now they make a shallow copy instead. * src/qpid/framing/Handler.h, FrameHandler.h: Simplified. * src/qpid/client/ClientConnection.cpp: * src/qpid/broker/Connection.cpp: * src/qpid/broker/BrokerChannel.cpp: Update for ChannelAdapter changes. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@551336 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/InProcessBroker.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cpp/src/tests/InProcessBroker.h') diff --git a/cpp/src/tests/InProcessBroker.h b/cpp/src/tests/InProcessBroker.h index 96f8ce72cf..8628bde431 100644 --- a/cpp/src/tests/InProcessBroker.h +++ b/cpp/src/tests/InProcessBroker.h @@ -48,15 +48,15 @@ class InProcessBroker : public client::Connector { /** A frame tagged with the sender */ struct TaggedFrame { - TaggedFrame(Sender e, framing::AMQFrame* f) : frame(f), sender(e) {} + TaggedFrame(Sender e, framing::AMQFrame& f) : frame(f), sender(e) {} bool fromBroker() const { return sender == BROKER; } bool fromClient() const { return sender == CLIENT; } template MethodType* asMethod() { - return dynamic_cast(frame->getBody().get()); + return dynamic_cast(frame.getBody().get()); } - shared_ptr frame; + framing::AMQFrame frame; Sender sender; }; @@ -85,7 +85,7 @@ class InProcessBroker : public client::Connector { } /** Called by client to send a frame */ - void send(framing::AMQFrame* frame) { + void send(framing::AMQFrame& frame) { clientOut.send(frame); } @@ -100,7 +100,7 @@ class InProcessBroker : public client::Connector { framing::InputHandler* ih=0 ) : sender(sender_), conversation(conversation_), in(ih) {} - void send(framing::AMQFrame* frame) { + void send(framing::AMQFrame& frame) { conversation.push_back(TaggedFrame(sender, frame)); in->received(frame); } @@ -122,7 +122,7 @@ class InProcessBroker : public client::Connector { std::ostream& operator<<( std::ostream& out, const InProcessBroker::TaggedFrame& tf) { - return out << (tf.fromBroker()? "BROKER: ":"CLIENT: ") << *tf.frame; + return out << (tf.fromBroker()? "BROKER: ":"CLIENT: ") << tf.frame; } std::ostream& operator<<( -- cgit v1.2.1