5 #ifndef __DDS__ProtocolMessage__ 6 #define __DDS__ProtocolMessage__ 13 #include <boost/crc.hpp> 17 namespace protocol_api
50 unsigned char const* buf = reinterpret_cast<unsigned char const*>(
this);
51 boost::crc_16_type crc16;
52 crc16.process_bytes(buf +
sizeof(uint16_t),
sizeof(
SMessageHeader) -
sizeof(uint16_t));
54 return crc16.checksum();
80 typedef dataContainer_t::value_type
data_t;
104 _encode_message(_cmd, _data, _ID);
108 void resize(
size_t _size);
125 void _encode_message(uint16_t _cmd,
const dataContainer_t& _data, uint64_t _ID);
void clear()
Definition: ProtocolMessage.cpp:27
CProtocolMessage()
Definition: ProtocolMessage.cpp:16
std::string toString() const
Definition: ProtocolMessage.cpp:134
void resize(size_t _size)
Definition: ProtocolMessage.cpp:34
Definition: ProtocolMessage.h:76
dataContainer_t bodyToContainer() const
Definition: ProtocolMessage.h:118
std::vector< unsigned char > BYTEVector_t
An STL vector of bytes.
Definition: def.h:124
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
Definition: ProtocolMessage.h:89
void encode(uint16_t _cmd, const dds::misc::BYTEVector_t &_data, uint64_t _ID)
Definition: ProtocolMessage.h:102
Definition: ProtocolMessage.h:85
const SMessageHeader & header() const
Definition: ProtocolMessage.cpp:129
size_t body_length() const
Definition: ProtocolMessage.cpp:64
const data_t * data() const
Definition: ProtocolMessage.cpp:39
const data_t * body() const
Definition: ProtocolMessage.cpp:54
dataContainer_t::value_type data_t
Definition: ProtocolMessage.h:80
size_t length() const
Definition: ProtocolMessage.cpp:49
dds::misc::BYTEVector_t dataContainer_t
Definition: ProtocolMessage.h:79
bool decode_header()
Definition: ProtocolMessage.cpp:75
std::shared_ptr< CProtocolMessage > protocolMessagePtr_t
Definition: ProtocolMessage.h:81