Public Member Functions | Public Attributes | Protected Member Functions | List of all members
packet_handler::payloadBase Class Referenceabstract

Provides base class for payloads. More...

#include <payload_base.hpp>

Inheritance diagram for packet_handler::payloadBase:
Inheritance graph
[legend]

Public Member Functions

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 ()
 

Public Attributes

const bool is_dynamic
 
const unsigned char length
 
bool yes
 

Protected Member Functions

template<>
void buildBytes (const float &V, ecl::PushAndPop< unsigned char > &buffer)
 
template<typename T >
void buildBytes (const T &V, ecl::PushAndPop< unsigned char > &buffer)
 
template<>
void buildVariable (float &V, ecl::PushAndPop< unsigned char > &buffer)
 
template<typename T >
void buildVariable (T &V, ecl::PushAndPop< unsigned char > &buffer)
 

Detailed Description

Provides base class for payloads.

Definition at line 44 of file payload_base.hpp.

Constructor & Destructor Documentation

◆ payloadBase()

packet_handler::payloadBase::payloadBase ( const bool  is_dynamic_ = false,
const unsigned char  length_ = 0 
)
inline

Definition at line 78 of file payload_base.hpp.

◆ ~payloadBase()

virtual packet_handler::payloadBase::~payloadBase ( )
inlinevirtual

Definition at line 83 of file payload_base.hpp.

Member Function Documentation

◆ buildBytes() [1/2]

template<>
void packet_handler::payloadBase::buildBytes ( const float &  V,
ecl::PushAndPop< unsigned char > &  buffer 
)
inlineprotected

Definition at line 136 of file payload_base.hpp.

◆ buildBytes() [2/2]

template<typename T >
void packet_handler::payloadBase::buildBytes ( const T &  V,
ecl::PushAndPop< unsigned char > &  buffer 
)
inlineprotected

Definition at line 110 of file payload_base.hpp.

◆ buildVariable() [1/2]

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
V
buffer

Definition at line 119 of file payload_base.hpp.

◆ buildVariable() [2/2]

template<typename T >
void packet_handler::payloadBase::buildVariable ( T &  V,
ecl::PushAndPop< unsigned char > &  buffer 
)
inlineprotected

Definition at line 96 of file payload_base.hpp.

◆ deserialise()

virtual bool packet_handler::payloadBase::deserialise ( ecl::PushAndPop< unsigned char > &  byteStream)
pure virtual

◆ serialise()

virtual bool packet_handler::payloadBase::serialise ( ecl::PushAndPop< unsigned char > &  byteStream)
pure virtual

Member Data Documentation

◆ is_dynamic

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 66 of file payload_base.hpp.

◆ length

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 73 of file payload_base.hpp.

◆ yes

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 60 of file payload_base.hpp.


The documentation for this class was generated from the following file:


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Wed Mar 2 2022 00:26:14