Provides base class for payloads.
More...
#include <payload_base.hpp>
|
virtual bool | deserialise (ecl::PushAndPop< unsigned char > &byteStream)=0 |
|
| payloadBase (const bool is_dynamic_=false, const unsigned char length_=0) |
|
virtual bool | serialise (ecl::PushAndPop< unsigned char > &byteStream)=0 |
|
virtual | ~payloadBase () |
|
|
template<typename T > |
void | buildBytes (const T &V, ecl::PushAndPop< unsigned char > &buffer) |
|
template<> |
void | buildBytes (const float &V, ecl::PushAndPop< unsigned char > &buffer) |
|
template<typename T > |
void | buildVariable (T &V, ecl::PushAndPop< unsigned char > &buffer) |
|
template<> |
void | buildVariable (float &V, ecl::PushAndPop< unsigned char > &buffer) |
|
Provides base class for payloads.
Definition at line 38 of file payload_base.hpp.
packet_handler::payloadBase::payloadBase |
( |
const bool |
is_dynamic_ = false , |
|
|
const unsigned char |
length_ = 0 |
|
) |
| |
|
inline |
virtual packet_handler::payloadBase::~payloadBase |
( |
| ) |
|
|
inlinevirtual |
template<typename T >
void packet_handler::payloadBase::buildBytes |
( |
const T & |
V, |
|
|
ecl::PushAndPop< unsigned char > & |
buffer |
|
) |
| |
|
inlineprotected |
template<>
void packet_handler::payloadBase::buildBytes |
( |
const float & |
V, |
|
|
ecl::PushAndPop< unsigned char > & |
buffer |
|
) |
| |
|
inlineprotected |
template<typename T >
void packet_handler::payloadBase::buildVariable |
( |
T & |
V, |
|
|
ecl::PushAndPop< unsigned char > & |
buffer |
|
) |
| |
|
inlineprotected |
template<>
void packet_handler::payloadBase::buildVariable |
( |
float & |
V, |
|
|
ecl::PushAndPop< unsigned char > & |
buffer |
|
) |
| |
|
inlineprotected |
Need to be very careful with this - it will only work across platforms if they happen to be doing reinterpret_cast with the same float standard.
- Parameters
-
Definition at line 113 of file payload_base.hpp.
virtual bool packet_handler::payloadBase::deserialise |
( |
ecl::PushAndPop< unsigned char > & |
byteStream | ) |
|
|
pure virtual |
Implemented in kobuki::Command, kobuki::CoreSensors, kobuki::GpInput, kobuki::ThreeAxisGyro, kobuki::Firmware, kobuki::Eeprom, kobuki::Inertia, kobuki::ControllerInfo, kobuki::Current, kobuki::UniqueDeviceID, kobuki::Cliff, kobuki::DockIR, and kobuki::Hardware.
virtual bool packet_handler::payloadBase::serialise |
( |
ecl::PushAndPop< unsigned char > & |
byteStream | ) |
|
|
pure virtual |
Implemented in kobuki::Command, kobuki::CoreSensors, kobuki::ThreeAxisGyro, kobuki::Firmware, kobuki::GpInput, kobuki::Current, kobuki::Eeprom, kobuki::ControllerInfo, kobuki::Inertia, kobuki::UniqueDeviceID, kobuki::Cliff, kobuki::DockIR, and kobuki::Hardware.
const bool packet_handler::payloadBase::is_dynamic |
it indicates the type of derived packet. if packet type is dynamic, length of packet can be changed during communication session. Ohterwise can not.
Definition at line 52 of file payload_base.hpp.
const unsigned char packet_handler::payloadBase::length |
it indicates length of data part of packet, except header and length field. if packet is fixed type, this value should be matched with length field. if packet is dynamic type, this value indicates minimal value of length field.
Definition at line 59 of file payload_base.hpp.
bool packet_handler::payloadBase::yes |
this is simple magic to write the flag, when we get the packet from the host or when we want to send the data
Definition at line 46 of file payload_base.hpp.
The documentation for this class was generated from the following file: