21 #ifndef _StructHelper_
22 #define _StructHelper_
37 template <
class T>
void encode(
const T& t, std::string& data) {
40 Buffer wbuffer(const_cast<char*>(data.data()), size);
42 t.encodeStructBody(wbuffer);
45 template <
class T>
void decode(T& t,
const std::string& data) {
46 Buffer rbuffer(const_cast<char*>(data.data()), data.length());
48 if (type == T::TYPE) {
49 t.decodeStructBody(rbuffer);
51 throw Exception(
"Type code does not match");
void encode(const T &t, std::string &data)
Base class for Qpid runtime exceptions.
This file was automatically generated from the AMQP specification.
void putShort(uint16_t i)
void decode(T &t, const std::string &data)
#define QPID_COMMON_CLASS_EXTERN