summaryrefslogtreecommitdiff
path: root/qpid/cpp/lib/common/framing/AMQFrame.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2007-01-09 19:44:50 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2007-01-09 19:44:50 +0000
commit13659cefe235ac0228749ba53e534910b9aae193 (patch)
tree048e91f6708aa307a239ad1df65f551161a971ba /qpid/cpp/lib/common/framing/AMQFrame.cpp
parent639e998c5fe03fc0a73667887af6a1828d400c0e (diff)
downloadqpid-python-13659cefe235ac0228749ba53e534910b9aae193.tar.gz
Most of remaining version changes for C++. Still need to deal with AMQFrame
defualt constructor and do some clean up here and there.. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@494540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib/common/framing/AMQFrame.cpp')
-rw-r--r--qpid/cpp/lib/common/framing/AMQFrame.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/qpid/cpp/lib/common/framing/AMQFrame.cpp b/qpid/cpp/lib/common/framing/AMQFrame.cpp
index ca8bf41758..6fa5b9ae51 100644
--- a/qpid/cpp/lib/common/framing/AMQFrame.cpp
+++ b/qpid/cpp/lib/common/framing/AMQFrame.cpp
@@ -24,24 +24,22 @@
using namespace qpid::framing;
-// This only works as a static as the version is currently fixed to 8.0
-// TODO: When the class is version-aware this will need to change
-AMQP_MethodVersionMap AMQFrame::versionMap(8,0);
-
-// AMQP version management change - kpvdr 2-11-17
-// TODO: Make this class version-aware
-AMQFrame::AMQFrame() {}
-
-// AMQP version management change - kpvdr 2006-11-17
-// TODO: Make this class version-aware
-AMQFrame::AMQFrame(u_int16_t _channel, AMQBody* _body) :
-channel(_channel), body(_body)
+
+AMQP_MethodVersionMap AMQFrame::versionMap;
+
+
+AMQFrame::AMQFrame(qpid::framing::ProtocolVersion& _version):
+version(_version)
{}
-// AMQP version management change - kpvdr 2006-11-17
-// TODO: Make this class version-aware
-AMQFrame::AMQFrame(u_int16_t _channel, AMQBody::shared_ptr& _body) :
-channel(_channel), body(_body)
+
+AMQFrame::AMQFrame(qpid::framing::ProtocolVersion& _version, u_int16_t _channel, AMQBody* _body) :
+version(_version), channel(_channel), body(_body)
+{}
+
+
+AMQFrame::AMQFrame(qpid::framing::ProtocolVersion& _version, u_int16_t _channel, AMQBody::shared_ptr& _body) :
+version(_version), channel(_channel), body(_body)
{}
AMQFrame::~AMQFrame() {}
@@ -66,11 +64,7 @@ void AMQFrame::encode(Buffer& buffer)
AMQBody::shared_ptr AMQFrame::createMethodBody(Buffer& buffer){
u_int16_t classId = buffer.getShort();
u_int16_t methodId = buffer.getShort();
- // 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));
+ AMQBody::shared_ptr body(versionMap.createMethodBody(classId, methodId, version.getMajor(), version.getMinor()));
return body;
}