summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2006-12-11 18:02:50 +0000
committerKim van der Riet <kpvdr@apache.org>2006-12-11 18:02:50 +0000
commit2cae8d35ea34da62756f0134edcecad417f7ea98 (patch)
treee61cd8c1a4027ae453869bb596bc7bb72ba19a9c
parent5f3d9cf0aa6da8f619ca9fcc7fa8294efcaade8e (diff)
downloadqpid-python-2cae8d35ea34da62756f0134edcecad417f7ea98.tar.gz
Added new Content class and other methods in Buffer to support the new transport in AMQP 0-9. This will allow the code produced by the code generator for 0-9 to compile.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@485780 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/lib/common/Makefile.am2
-rw-r--r--cpp/lib/common/framing/Buffer.cpp9
-rw-r--r--cpp/lib/common/framing/Buffer.h4
-rw-r--r--cpp/lib/common/framing/Content.cpp41
-rw-r--r--cpp/lib/common/framing/Content.h47
5 files changed, 103 insertions, 0 deletions
diff --git a/cpp/lib/common/Makefile.am b/cpp/lib/common/Makefile.am
index ed2ccd61a8..21eaf12ff2 100644
--- a/cpp/lib/common/Makefile.am
+++ b/cpp/lib/common/Makefile.am
@@ -71,6 +71,8 @@ libcommon_la_SOURCES = \
$(framing)/BodyHandler.h \
$(framing)/Buffer.cpp \
$(framing)/Buffer.h \
+ $(framing)/Content.cpp \
+ $(framing)/Content.h \
$(framing)/FieldTable.cpp \
$(framing)/FieldTable.h \
$(framing)/HeaderProperties.h \
diff --git a/cpp/lib/common/framing/Buffer.cpp b/cpp/lib/common/framing/Buffer.cpp
index f25b2a47c0..77b000193a 100644
--- a/cpp/lib/common/framing/Buffer.cpp
+++ b/cpp/lib/common/framing/Buffer.cpp
@@ -19,6 +19,7 @@
*
*/
#include <Buffer.h>
+#include <Content.h>
#include <FieldTable.h>
qpid::framing::Buffer::Buffer(u_int32_t _size) : size(_size), owner(true), position(0), limit(_size){
@@ -162,6 +163,14 @@ void qpid::framing::Buffer::getFieldTable(FieldTable& t){
t.decode(*this);
}
+void qpid::framing::Buffer::putContent(const Content& c){
+ c.encode(*this);
+}
+
+void qpid::framing::Buffer::getContent(Content& c){
+ c.decode(*this);
+}
+
void qpid::framing::Buffer::putRawData(const string& s){
u_int32_t len = s.length();
s.copy(data + position, len);
diff --git a/cpp/lib/common/framing/Buffer.h b/cpp/lib/common/framing/Buffer.h
index 92a25ee4c8..b07c2a2ced 100644
--- a/cpp/lib/common/framing/Buffer.h
+++ b/cpp/lib/common/framing/Buffer.h
@@ -26,6 +26,7 @@
namespace qpid {
namespace framing {
+class Content;
class FieldTable;
class Buffer
@@ -71,6 +72,9 @@ public:
void putFieldTable(const FieldTable& t);
void getFieldTable(FieldTable& t);
+ void putContent(const Content& c);
+ void getContent(Content& c);
+
void putRawData(const string& s);
void getRawData(string& s, u_int32_t size);
diff --git a/cpp/lib/common/framing/Content.cpp b/cpp/lib/common/framing/Content.cpp
new file mode 100644
index 0000000000..cd8e144906
--- /dev/null
+++ b/cpp/lib/common/framing/Content.cpp
@@ -0,0 +1,41 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include <Buffer.h>
+#include <Content.h>
+
+namespace qpid
+{
+namespace framing
+{
+
+Content::~Content() {}
+
+void Content::encode(Buffer&) const
+{
+}
+
+void Content::decode(Buffer&)
+{
+}
+
+
+} // namespace framing
+} // namespace qpid
diff --git a/cpp/lib/common/framing/Content.h b/cpp/lib/common/framing/Content.h
new file mode 100644
index 0000000000..1ab3ba468b
--- /dev/null
+++ b/cpp/lib/common/framing/Content.h
@@ -0,0 +1,47 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef _Content_
+#define _Content_
+
+namespace qpid
+{
+namespace framing
+{
+
+/*
+ * TODO: New Content class required for AMQP 0-9. This is a stub only.
+ */
+class Content
+{
+ public:
+ ~Content();
+
+ void encode(Buffer& buffer) const;
+ void decode(Buffer& buffer);
+
+};
+
+} // namespace framing
+} // namespace qpid
+
+
+#endif