35 #ifndef SICK_SAFETYSCANNERS_DATA_PROCESSING_READWRITEHELPER_HPP 36 #define SICK_SAFETYSCANNERS_DATA_PROCESSING_READWRITEHELPER_HPP 41 namespace read_write_helper {
53 inline void writeUint8(std::vector<uint8_t>::iterator it,
const uint8_t v)
89 inline void writeInt8(std::vector<uint8_t>::iterator it,
const uint8_t v)
127 *(it + 0) = (v & 0xff00) >> 8;
128 *(it + 1) = v & 0xff;
140 *(it + 0) = v & 0xff;
141 *(it + 1) = (v & 0xff00) >> 8;
154 *(it + 0) = (v & 0xff000000) >> 24;
155 *(it + 1) = (v & 0xff0000) >> 16;
156 *(it + 2) = (v & 0xff00) >> 8;
157 *(it + 3) = v & 0xff;
169 *(it + 3) = (v & 0xff000000) >> 24;
170 *(it + 2) = (v & 0xff0000) >> 16;
171 *(it + 1) = (v & 0xff00) >> 8;
172 *(it + 0) = v & 0xff;
183 inline uint8_t
readUint8(std::vector<uint8_t>::const_iterator it)
222 inline int8_t
readInt8(std::vector<uint8_t>::const_iterator it)
263 return (*(it + 0) << 8) + *(it + 1);
276 return (*(it + 1) << 8) + *(it + 0);
315 return (*(it + 0) << 24) + (*(it + 1) << 16) + (*(it + 2) << 8) + *(it + 3);
328 return (*(it + 3) << 24) + (*(it + 2) << 16) + (*(it + 1) << 8) + *(it + 0);
341 return (*(it + 0) << 24) + (*(it + 1) << 16) + (*(it + 2) << 8) + *(it + 3);
355 return (*(it + 3) << 24) + (*(it + 2) << 16) + (*(it + 1) << 8) + *(it + 0);
361 #endif // SICK_SAFETYSCANNERS_DATA_PROCESSING_READWRITEHELPER_HPP void writeUint32BigEndian(std::vector< uint8_t >::iterator it, const uint32_t v)
Writes an unsigned 32-bit integer to a buffer at offset in big endian encoding.
int8_t readInt8BigEndian(std::vector< uint8_t >::const_iterator it)
Read a signed 8-bit integer at offset in big endian encoding.
void writeUint8BigEndian(std::vector< uint8_t >::iterator it, const uint8_t v)
Writes an unsigned 8-bit integer to a buffer at offset in big endian encoding.
void writeInt8(std::vector< uint8_t >::iterator it, const uint8_t v)
Writes a signed 8-bit integer to a buffer at offset.
uint8_t readUint8BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset in big endian encoding.
int8_t readInt8(std::vector< uint8_t >::const_iterator it)
Read a signed 8-bit integer at offset.
int8_t readInt8LittleEndian(std::vector< uint8_t >::const_iterator it)
Read a signed 8-bit integer at offset in little endian encoding.
uint8_t readUint8LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset in big little encoding.
uint32_t readUint32BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in big endian encoding.
void writeUint8(std::vector< uint8_t >::iterator it, const uint8_t v)
Helper Functions read and write data at a certain place in a buffer.
uint32_t readUint32LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in little endian encoding.
int32_t readInt32LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in little endian encoding.
void writeInt8BigEndian(std::vector< uint8_t >::iterator it, const uint8_t v)
Writes a signed 8-bit integer to a buffer at offset in big endian encoding.
void writeUint16BigEndian(std::vector< uint8_t >::iterator it, const uint16_t v)
Writes an unsigned 16-bit integer to a buffer at offset in big endian encoding.
int16_t readInt16BigEndian(std::vector< uint8_t >::const_iterator it)
Read a signed 16-bit integer at offset in big endian encoding.
uint16_t readUint16BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 16-bit integer at offset in big endian encoding.
void writeUint32LittleEndian(std::vector< uint8_t >::iterator it, const uint32_t v)
Writes an unsigned 32-bit integer to a buffer at offset in little endian encoding.
int32_t readInt32BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in big endian encoding.
void writeUint8LittleEndian(std::vector< uint8_t >::iterator it, const uint8_t v)
Writes an unsigned 8-bit integer to a buffer at offset in little endian encoding. ...
void writeInt8LittleEndian(std::vector< uint8_t >::iterator it, const uint8_t v)
Writes a signed 8-bit integer to a buffer at offset in little endian encoding.
void writeUint16LittleEndian(std::vector< uint8_t >::iterator it, const uint16_t v)
Writes an unsigned 16-bit integer to a buffer at offset in little endian encoding.
uint8_t readUint8(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset.
uint16_t readUint16LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 16-bit integer at offset in little endian encoding.
int16_t readInt16LittleEndian(std::vector< uint8_t >::const_iterator it)
Read a signed 16-bit integer at offset in little endian encoding.