summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/AMQFrame.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-08-28 19:38:17 +0000
committerGordon Sim <gsim@apache.org>2007-08-28 19:38:17 +0000
commit9e10f4ea3b2f8ab6650f635cada48e4735ca20d7 (patch)
tree26ad3b8dffa17fa665fe7a033a7c8092839df011 /cpp/src/qpid/framing/AMQFrame.cpp
parent6b09696b216c090b512c6af92bf7976ae3407add (diff)
downloadqpid-python-9e10f4ea3b2f8ab6650f635cada48e4735ca20d7.tar.gz
Updated message.transfer encoding to use header and content segments (including new structs).
Unified more between the basic and message classes messages. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/AMQFrame.cpp')
-rw-r--r--cpp/src/qpid/framing/AMQFrame.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpp/src/qpid/framing/AMQFrame.cpp b/cpp/src/qpid/framing/AMQFrame.cpp
index 780af71be4..a7fd068ee4 100644
--- a/cpp/src/qpid/framing/AMQFrame.cpp
+++ b/cpp/src/qpid/framing/AMQFrame.cpp
@@ -70,7 +70,7 @@ const AMQBody* AMQFrame::getBody() const {
return boost::apply_visitor(GetBodyVisitor(), const_cast<Variant&>(body));
}
-void AMQFrame::encode(Buffer& buffer)
+void AMQFrame::encode(Buffer& buffer) const
{
buffer.putOctet(getBody()->type());
buffer.putShort(channel);
@@ -80,8 +80,11 @@ void AMQFrame::encode(Buffer& buffer)
}
uint32_t AMQFrame::size() const{
- return 1/*type*/ + 2/*channel*/ + 4/*body size*/ +
- boost::apply_visitor(SizeVisitor(), body) + 1/*0xCE*/;
+ return frameOverhead() + boost::apply_visitor(SizeVisitor(), body);
+}
+
+uint32_t AMQFrame::frameOverhead() {
+ return 1/*type*/ + 2/*channel*/ + 4/*body size*/ + 1/*0xCE*/;
}
bool AMQFrame::decode(Buffer& buffer)