summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-03-02 23:30:08 +0000
committerAlan Conway <aconway@apache.org>2009-03-02 23:30:08 +0000
commita179ded965c5cc70a0666d07737c38c67c1558c1 (patch)
tree9c854273164ee106eaa611dd68870d818abfc2c1 /cpp/src/qpid/framing
parente669e97c7f1c034841986e18288af7629d356aa2 (diff)
downloadqpid-python-a179ded965c5cc70a0666d07737c38c67c1558c1.tar.gz
Replicate connection decoder fragments to new members.
Refactoring: - Merge Decoder into ConnectionMap. - Process cluster controls in event queue thread. - Use counter not pointer for connection ID, avoid re-use. - Do all processing in event queue thread to avoid races (temporary pending performance measurements) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@749473 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
-rw-r--r--cpp/src/qpid/framing/FrameDecoder.cpp12
-rw-r--r--cpp/src/qpid/framing/FrameDecoder.h9
2 files changed, 19 insertions, 2 deletions
diff --git a/cpp/src/qpid/framing/FrameDecoder.cpp b/cpp/src/qpid/framing/FrameDecoder.cpp
index cbdac181e9..6f0ae9756f 100644
--- a/cpp/src/qpid/framing/FrameDecoder.cpp
+++ b/cpp/src/qpid/framing/FrameDecoder.cpp
@@ -21,8 +21,9 @@
#include "FrameDecoder.h"
#include "Buffer.h"
#include "qpid/log/Statement.h"
-#include <algorithm>
#include "qpid/framing/reply_exceptions.h"
+#include <algorithm>
+#include <string.h>
namespace qpid {
namespace framing {
@@ -67,4 +68,13 @@ bool FrameDecoder::decode(Buffer& buffer) {
return false;
}
+void FrameDecoder::setFragment(const char* data, size_t size) {
+ fragment.resize(size);
+ ::memcpy(fragment.data(), data, size);
+}
+
+std::pair<const char*, size_t> FrameDecoder::getFragment() const {
+ return std::pair<const char*, size_t>(fragment.data(), fragment.size());
+}
+
}} // namespace qpid::framing
diff --git a/cpp/src/qpid/framing/FrameDecoder.h b/cpp/src/qpid/framing/FrameDecoder.h
index 7f974dadc3..961cc666a9 100644
--- a/cpp/src/qpid/framing/FrameDecoder.h
+++ b/cpp/src/qpid/framing/FrameDecoder.h
@@ -35,9 +35,16 @@ class FrameDecoder
{
public:
bool decode(Buffer& buffer);
- AMQFrame frame;
+ const AMQFrame& getFrame() const { return frame; }
+ AMQFrame& getFrame() { return frame; }
+
+ void setFragment(const char*, size_t);
+ std::pair<const char*, size_t> getFragment() const;
+
private:
std::vector<char> fragment;
+ AMQFrame frame;
+
};
}} // namespace qpid::framing