summaryrefslogtreecommitdiff
path: root/cpp/lib/common/framing/AMQMethodBody.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-01-10 22:44:12 +0000
committerAlan Conway <aconway@apache.org>2007-01-10 22:44:12 +0000
commit804d660fc35571d764f2a7acc87cfe82ac31a95e (patch)
tree8ad062b1e1eb882d51d5407cb93e85e42469db53 /cpp/lib/common/framing/AMQMethodBody.cpp
parentb6b0463b260df363667c08131e5e5b16bb4daa5e (diff)
downloadqpid-python-804d660fc35571d764f2a7acc87cfe82ac31a95e.tar.gz
Encoding and decoding of AMQP 0-9 request and response frames.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@495018 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/common/framing/AMQMethodBody.cpp')
-rw-r--r--cpp/lib/common/framing/AMQMethodBody.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/cpp/lib/common/framing/AMQMethodBody.cpp b/cpp/lib/common/framing/AMQMethodBody.cpp
index 525310f3d4..cd6db9b1a9 100644
--- a/cpp/lib/common/framing/AMQMethodBody.cpp
+++ b/cpp/lib/common/framing/AMQMethodBody.cpp
@@ -20,27 +20,40 @@
*/
#include <AMQMethodBody.h>
#include <QpidError.h>
+#include "AMQP_MethodVersionMap.h"
-void qpid::framing::AMQMethodBody::encode(Buffer& buffer) const{
+namespace qpid {
+namespace framing {
+
+void AMQMethodBody::encode(Buffer& buffer) const{
buffer.putShort(amqpClassId());
buffer.putShort(amqpMethodId());
encodeContent(buffer);
}
-void qpid::framing::AMQMethodBody::decode(Buffer& buffer, u_int32_t /*size*/){
+void AMQMethodBody::decode(Buffer& buffer, u_int32_t /*size*/){
decodeContent(buffer);
}
-bool qpid::framing::AMQMethodBody::match(AMQMethodBody* other) const{
+bool AMQMethodBody::match(AMQMethodBody* other) const{
return other != 0 && other->amqpClassId() == amqpClassId() && other->amqpMethodId() == amqpMethodId();
}
-void qpid::framing::AMQMethodBody::invoke(AMQP_ServerOperations& /*target*/, u_int16_t /*channel*/){
+void AMQMethodBody::invoke(AMQP_ServerOperations& /*target*/, u_int16_t /*channel*/){
THROW_QPID_ERROR(PROTOCOL_ERROR, "Method not supported by AMQP Server.");
}
-std::ostream& qpid::framing::operator<<(std::ostream& out, const AMQMethodBody& m){
- m.print(out);
- return out;
+
+AMQMethodBody::shared_ptr AMQMethodBody::create(
+ AMQP_MethodVersionMap& versionMap, ProtocolVersion version,
+ Buffer& buffer)
+{
+ u_int16_t classId = buffer.getShort();
+ u_int16_t methodId = buffer.getShort();
+ return AMQMethodBody::shared_ptr(
+ versionMap.createMethodBody(
+ classId, methodId, version.getMajor(), version.getMinor()));
}
+
+}} // namespace qpid::framing