13 #ifndef ROBOT_DATA_HPP_
14 #define ROBOT_DATA_HPP_
59 const unsigned char length;
64 payloadBase(
const bool is_dynamic_ =
false,
const unsigned char length_ = 0 )
84 if (buffer.
size() <
sizeof(T))
86 V =
static_cast<unsigned char>(buffer.
pop_front());
88 unsigned int size_value(
sizeof(T));
89 for (
unsigned int i = 1; i < size_value; i++)
91 V |= ((
static_cast<unsigned char>(buffer.
pop_front())) << (8 * i));
98 unsigned int size_value(
sizeof(T));
99 for (
unsigned int i = 0; i < size_value; i++)
101 buffer.
push_back(
static_cast<unsigned char>((V >> (i * 8)) & 0xff));
115 if (buffer.
size() < 4)
118 ui =
static_cast<unsigned char>(buffer.
pop_front());
120 unsigned int size_value(4);
121 for (
unsigned int i = 1; i < size_value; i++)
123 ui |= ((
static_cast<unsigned char>(buffer.
pop_front())) << (8 * i));
126 V =
reinterpret_cast<float&
>(ui);
132 if (buffer.
size() < 4)
134 unsigned int size_value(4);
135 unsigned int ui(
reinterpret_cast<const unsigned int&
>(V));
136 for (
unsigned int i = 0; i < size_value; i++)
138 buffer.
push_back(
static_cast<unsigned char>((ui >> (i * 8)) & 0xff));