summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Makefile.am2
-rw-r--r--cpp/src/qpid/broker/SessionAdapter.h35
-rw-r--r--cpp/src/qpid/framing/FrameDefaultVisitor.h20
3 files changed, 31 insertions, 26 deletions
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am
index 387d4dce91..722653fb79 100644
--- a/cpp/src/Makefile.am
+++ b/cpp/src/Makefile.am
@@ -195,8 +195,6 @@ libqpidbroker_la_SOURCES = \
qpid/broker/SessionState.h \
qpid/broker/SuspendedSessions.h \
qpid/broker/SuspendedSessions.cpp \
- qpid/broker/SessionAdapter.h \
- qpid/broker/SessionAdapter.cpp \
qpid/broker/SemanticHandler.cpp \
qpid/broker/Timer.cpp \
qpid/broker/TopicExchange.cpp \
diff --git a/cpp/src/qpid/broker/SessionAdapter.h b/cpp/src/qpid/broker/SessionAdapter.h
index 9b4a843946..c82b88a27d 100644
--- a/cpp/src/qpid/broker/SessionAdapter.h
+++ b/cpp/src/qpid/broker/SessionAdapter.h
@@ -34,32 +34,35 @@ namespace broker {
* Implements AMQP session class commands, forwards other traffic
* to the next handler in the chain.
*/
-class SessionAdapter : public FrameVisitorHandler
-
+class SessionAdapter : public framing::FrameVisitorHandler
{
public:
- SessionAdapter(FrameHandler& out, SuspendedSessions&);
+ SessionAdapter(framing::FrameHandler& out, SuspendedSessions&);
~SessionAdapter();
protected:
- void visit(const SessionAckBody&);
- void visit(const SessionAttachedBody&);
- void visit(const SessionCloseBody&);
- void visit(const SessionClosedBody&);
- void visit(const SessionDetachedBody&);
- void visit(const SessionFlowBody&);
- void visit(const SessionFlowOkBody&);
- void visit(const SessionHighWaterMarkBody&);
- void visit(const SessionOpenBody&);
- void visit(const SessionResumeBody&);
- void visit(const SessionSolicitAckBody&);
- void visit(const SessionSuspendBody&);
+ void visit(const framing::SessionAckBody&);
+ void visit(const framing::SessionAttachedBody&);
+ void visit(const framing::SessionCloseBody&);
+ void visit(const framing::SessionClosedBody&);
+ void visit(const framing::SessionDetachedBody&);
+ void visit(const framing::SessionFlowBody&);
+ void visit(const framing::SessionFlowOkBody&);
+ void visit(const framing::SessionHighWaterMarkBody&);
+ void visit(const framing::SessionOpenBody&);
+ void visit(const framing::SessionResumeBody&);
+ void visit(const framing::SessionSolicitAckBody&);
+ void visit(const framing::SessionSuspendBody&);
+ using FrameDefaultVisitor::visit;
+
private:
SessionState state;
SuspendedSessions& suspended;
Chain next;
- FrameHandler& out;
+ framing::FrameHandler& out;
+};
+
}} // namespace qpid::broker
#endif /*!QPID_BROKER_SESSIONADAPTER_H*/
diff --git a/cpp/src/qpid/framing/FrameDefaultVisitor.h b/cpp/src/qpid/framing/FrameDefaultVisitor.h
index a66adf28c4..841785870e 100644
--- a/cpp/src/qpid/framing/FrameDefaultVisitor.h
+++ b/cpp/src/qpid/framing/FrameDefaultVisitor.h
@@ -23,12 +23,13 @@
#include "qpid/framing/MethodBodyDefaultVisitor.h"
#include "qpid/framing/AMQBody.h"
+#include "qpid/framing/AMQMethodBody.h"
+#include "qpid/framing/AMQFrame.h"
#include "qpid/framing/FrameHandler.h"
namespace qpid {
namespace framing {
-class AMQMethodBody;
class AMQHeaderBody;
class AMQContentBody;
class AMQHeartbeatBody;
@@ -44,23 +45,26 @@ class AMQHeartbeatBody;
*/
struct FrameDefaultVisitor : public AMQBodyConstVisitor, public MethodBodyDefaultVisitor
{
- void visit(const AMQHeaderBody& x) { defaultVisit(); }
- void visit(const AMQContentBody& x) { defaultVisit(); }
- void visit(const AMQHeartbeatBody& x) { defaultVisit(); }
- void visit(const AMQMethodBody& method) { method.accept(*this); }
+ void visit(const AMQHeaderBody&) { defaultVisit(); }
+ void visit(const AMQContentBody&) { defaultVisit(); }
+ void visit(const AMQHeartbeatBody&) { defaultVisit(); }
+ void visit(const AMQMethodBody& method) { method.accept(static_cast<MethodBodyDefaultVisitor&>(*this)); }
+
+ using AMQBodyConstVisitor::visit;
+ using MethodBodyDefaultVisitor::visit;
};
/**
* A FrameHandler that is implemented as a visitor.
*/
struct FrameVisitorHandler : public FrameHandler,
- protected FrameVisitorHandler
+ protected FrameDefaultVisitor
{
- void handle(AMQFrame& f) { f.accept(*this); }
+ void handle(AMQFrame& f) { f.getBody()->accept(*this); }
};
-
+}} // namespace qpid::framing
#endif /*!QPID_FRAMING_FRAMEVISITOR_H*/