From d46ac2955c4871c9f22067f47490095e2c5f1806 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Wed, 22 Nov 2006 16:57:35 +0000 Subject: Merged AMQP version-sensitive generated files with C++ trunk. Phase 1 of merge complete - all locations where version info is required in the framing, broker and client code, the version has been hard-coded to mahor=8, minor=0. Next step: make broker and client version-aware. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@478237 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/AMQFrame.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'cpp/src/qpid/framing/AMQFrame.cpp') diff --git a/cpp/src/qpid/framing/AMQFrame.cpp b/cpp/src/qpid/framing/AMQFrame.cpp index ba6f4fe2de..b58bc93545 100644 --- a/cpp/src/qpid/framing/AMQFrame.cpp +++ b/cpp/src/qpid/framing/AMQFrame.cpp @@ -24,14 +24,23 @@ using namespace qpid::framing; -AMQFrame::AMQFrame(){} +// AMQP version management change - kpvdr 2006-11-17 +// TODO: Make this class version-aware and link these hard-wired numbers to that version +AMQFrame::AMQFrame() : versionMap(8, 0) {} -AMQFrame::AMQFrame(u_int16_t _channel, AMQBody* _body) : channel(_channel), body(_body){} +// AMQP version management change - kpvdr 2006-11-17 +// TODO: Make this class version-aware and link these hard-wired numbers to that version +AMQFrame::AMQFrame(u_int16_t _channel, AMQBody* _body) : +channel(_channel), body(_body), versionMap(8, 0) +{} -AMQFrame::AMQFrame(u_int16_t _channel, AMQBody::shared_ptr& _body) : channel(_channel), body(_body){} +// AMQP version management change - kpvdr 2006-11-17 +// TODO: Make this class version-aware and link these hard-wired numbers to that version +AMQFrame::AMQFrame(u_int16_t _channel, AMQBody::shared_ptr& _body) : +channel(_channel), body(_body), versionMap(8, 0) +{} -AMQFrame::~AMQFrame(){ -} +AMQFrame::~AMQFrame() {} u_int16_t AMQFrame::getChannel(){ return channel; @@ -50,10 +59,14 @@ void AMQFrame::encode(Buffer& buffer) buffer.putOctet(0xCE); } -AMQBody::shared_ptr createMethodBody(Buffer& buffer){ +AMQBody::shared_ptr AMQFrame::createMethodBody(Buffer& buffer){ u_int16_t classId = buffer.getShort(); u_int16_t methodId = buffer.getShort(); - AMQBody::shared_ptr body(createAMQMethodBody(classId, methodId)); + // AMQP version management change - kpvdr 2006-11-16 + // TODO: Make this class version-aware and link these hard-wired numbers to that version + AMQBody::shared_ptr body(versionMap.createMethodBody(classId, methodId, 8, 0)); + // Origianl stmt: + // AMQBody::shared_ptr body(createAMQMethodBody(classId, methodId)); return body; } @@ -108,10 +121,13 @@ void AMQFrame::decodeBody(Buffer& buffer, uint32_t bufSize) body->decode(buffer, bufSize); } -std::ostream& qpid::framing::operator<<(std::ostream& out, const AMQFrame& t){ +std::ostream& qpid::framing::operator<<(std::ostream& out, const AMQFrame& t) +{ out << "Frame[channel=" << t.channel << "; "; - if (t.body.get() == 0) out << "empty"; - else out << *t.body; + if (t.body.get() == 0) + out << "empty"; + else + out << *t.body; out << "]"; return out; } -- cgit v1.2.1