diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2006-11-22 16:57:35 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2006-11-22 16:57:35 +0000 |
| commit | d46ac2955c4871c9f22067f47490095e2c5f1806 (patch) | |
| tree | 7e76ef7e4ca47e4cc57c83f7950bf97c3eceb210 /cpp/src/qpid/framing/AMQFrame.cpp | |
| parent | 018723f3889e9a1f63585dddba8eecff1d168501 (diff) | |
| download | qpid-python-d46ac2955c4871c9f22067f47490095e2c5f1806.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/framing/AMQFrame.cpp')
| -rw-r--r-- | cpp/src/qpid/framing/AMQFrame.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
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; } |
