summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/amqp_0_10/Header.h
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src/qpid/amqp_0_10/Header.h')
-rw-r--r--qpid/cpp/src/qpid/amqp_0_10/Header.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/qpid/cpp/src/qpid/amqp_0_10/Header.h b/qpid/cpp/src/qpid/amqp_0_10/Header.h
index 44edcb9f3d..b3498a1c8c 100644
--- a/qpid/cpp/src/qpid/amqp_0_10/Header.h
+++ b/qpid/cpp/src/qpid/amqp_0_10/Header.h
@@ -21,21 +21,32 @@
* under the License.
*
*/
+#include "qpid/amqp_0_10/built_in_types.h"
+#include "qpid/amqp_0_10/Struct32.h"
+#include <vector>
#include <ostream>
namespace qpid {
namespace amqp_0_10 {
-// FIXME aconway 2008-03-27: TODO
-class Header
-{
+class Header : public std::vector<Struct32> {
public:
- template <class S> void serialize(S&) {}
- private:
+ Header() {}
+
+ template <class S> void serialize(S& s) { s.split(*this); }
+ template <class S> void encode(S& s) const { s(this->begin(), this->end()); }
+ template <class S> void decode(S& s);
};
-// FIXME aconway 2008-03-28: TODO
-inline std::ostream& operator<<(std::ostream& o, const Header&) { return o; }
+template <class S> void Header::decode(S& s) {
+ this->clear();
+ while (s.bytesRemaining() > 0) {
+ this->push_back(Struct32());
+ s(this->back());
+ }
+}
+
+std::ostream& operator<<(std::ostream& o, const Header&);
}} // namespace qpid::amqp_0_10