summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/AMQFrame.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-01-22 21:48:47 +0000
committerAlan Conway <aconway@apache.org>2009-01-22 21:48:47 +0000
commit27014f9f861f6ce3f3205c91f2fd3927da02e382 (patch)
tree8bb01bd72fece68527bc970688ee35ba04aff93b /cpp/src/qpid/framing/AMQFrame.h
parent1a14b81c86c49d562486ab2c55a75c564144fa71 (diff)
downloadqpid-python-27014f9f861f6ce3f3205c91f2fd3927da02e382.tar.gz
Optimization: cache results of AMQFrame::encodedSize().
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@736810 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/AMQFrame.h')
-rw-r--r--cpp/src/qpid/framing/AMQFrame.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/framing/AMQFrame.h b/cpp/src/qpid/framing/AMQFrame.h
index f1ea2f8b82..02a1ea4622 100644
--- a/cpp/src/qpid/framing/AMQFrame.h
+++ b/cpp/src/qpid/framing/AMQFrame.h
@@ -43,8 +43,8 @@ class AMQFrame : public AMQDataBlock, public sys::LatencyMetricTimestamp
ChannelId getChannel() const { return channel; }
void setChannel(ChannelId c) { channel = c; }
- AMQBody* getBody() { return body.get(); }
- const AMQBody* getBody() const { return body.get(); }
+ AMQBody* getBody();
+ const AMQBody* getBody() const;
AMQMethodBody* getMethod() { return getBody()->getMethod(); }
const AMQMethodBody* getMethod() const { return getBody()->getMethod(); }
@@ -102,6 +102,7 @@ class AMQFrame : public AMQDataBlock, public sys::LatencyMetricTimestamp
bool eof : 1;
bool bos : 1;
bool eos : 1;
+ mutable uint32_t encodedSizeCache;
};
std::ostream& operator<<(std::ostream&, const AMQFrame&);