#include <MessageHelper.h>

Public Member Functions | |
| MessageHelper () | |
| virtual | ~MessageHelper () |
| void | SetBuffer (void *const buffer) |
| void * | GetBuffer (void) const |
| void * | GetCurrentPosition (void) const |
| virtual void | AddVariable (const void *variable, const int size) |
| virtual void | AddData (const void *data, const int size) |
| void | GetVariable (void *const variable, const int size) |
| void | GetData (void *const data, const int size) |
| int | GetSize (void) const |
| void | SetSize (const int size) |
| void | AddInteger (const int value) |
| void | AddFloat (const float value) |
| int | GetInteger (void) |
| float | GetFloat (void) |
| std::string | DumpAsHex (const bool csv=true) |
| void | SetGuardSize (const int size=-1) |
Static Public Member Functions | |
| static std::string | DumpAsHex (const void *data, const int size, const bool csv=true) |
Classes | |
| class | Exception |
| MessageHelper | ( | ) |
The ctor performs some basic initialisation
| virtual ~MessageHelper | ( | ) | [virtual] |
The dtor makes sure everything is tidy
| void SetBuffer | ( | void *const | buffer | ) |
Sets the data buffer pointer to use while constructing or deconstructing this message. This also causes the length of the buffer to revert to zero.
| buffer | the buffer pointer to set |
| void* GetBuffer | ( | void | ) | const |
Gets the pointer to the start of the buffer.
| void* GetCurrentPosition | ( | void | ) | const |
Gets the pointer to the current position in the buffer.
| virtual void AddVariable | ( | const void * | variable, | |
| const int | size | |||
| ) | [virtual] |
Adds a variable of a specified size to the message buffer while using an endian check to preserve the value between platforms with different endian formats
| variable | the pointer to the variable | |
| size | the size of the data |
Reimplemented in DynamicMessageHelper.
| virtual void AddData | ( | const void * | data, | |
| const int | size | |||
| ) | [virtual] |
Adds a data block of a specified size to the message buffer without using any endian checking
| data | the pointer to the data | |
| size | the size of the data |
Reimplemented in DynamicMessageHelper.
| void GetVariable | ( | void *const | variable, | |
| const int | size | |||
| ) |
Gets a variable of a specified size from the message buffer
| variable | the pointer to the variable | |
| size | the size of the data |
| void GetData | ( | void *const | data, | |
| const int | size | |||
| ) |
Gets data of a specified size from the message buffer
| data | the pointer to the data | |
| size | the size of the data |
| int GetSize | ( | void | ) | const |
Returns the current size of the message in bytes
| void SetSize | ( | const int | size | ) |
Sets the current size of the message in bytes.
| the | size of the message in bytes |
Reimplemented in DynamicMessageHelper.
| void AddInteger | ( | const int | value | ) |
Adds an integer to the message buffer
| value | the value to add |
| void AddFloat | ( | const float | value | ) |
Adds a float to the message buffer
| value | the value to add |
| int GetInteger | ( | void | ) |
Gets an integer from the message buffer
| value | the value to get |
| float GetFloat | ( | void | ) |
Gets a float from the message buffer
| value | the value to get |
| static std::string DumpAsHex | ( | const void * | data, | |
| const int | size, | |||
| const bool | csv = true | |||
| ) | [static] |
This produces a hex dump of any length of data
| void SetGuardSize | ( | const int | size = -1 |
) |
Sets the guard size and if the MessageHepler reads past the guard a MessageHepler::Exception() exception is thrown.
| size | If < 0 then the exception is disabled. Otherwise an exception is thrown when data is read beyond the size configured. |
1.5.3