ADTF
3.18.4
|
Bit Serializer Class. More...
Public Member Functions | |
BitSerializer (void *data, size_t data_size) | |
Constructor. | |
BitSerializer () | |
Default Constructor. | |
template<typename T > | |
a_util::result::Result | read (size_t start_bit, size_t bit_length, T *value, Endianess endianess=get_platform_endianess()) |
Read value from bitfield. More... | |
template<typename T > | |
a_util::result::Result | write (size_t start_bit, size_t bit_length, T value, Endianess endianess=get_platform_endianess()) |
Write value to bitfield. More... | |
Private Member Functions | |
a_util::result::Result | checkForInvalidArguments (size_t start_bit, size_t bit_length, size_t size_variable) |
Check if the parameters for the reading and writing access are valid. More... | |
Private Attributes | |
uint8_t * | _buffer |
internal buffer | |
size_t | _buffer_bytes |
size of internal buffer in bytes | |
size_t | _buffer_bits |
size of internal buffer in bits | |
Bit Serializer Class.
Definition at line 607 of file workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
|
inlineprivate |
Check if the parameters for the reading and writing access are valid.
The variable to read from or into might be too small and the accessed region of the memory buffer might be out of range.
[in] | start_bit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | bit_length | Number of bits to read. |
[in] | size_variable | Size of the variable to read into or write from. |
Definition at line 708 of file workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
References BitSerializer::_buffer, and BitSerializer::_buffer_bits.
Referenced by BitSerializer::read(), and BitSerializer::write().
|
inline |
Read value from bitfield.
Value can be of type tFloat or an unsigned or signed integer.
....|...*****|********|**......|.... Buffer (index 0 on the right end side) |_______________| bit_length ^ | start_bit
[in] | start_bit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | bit_length | Number of bits to read. |
[out] | value | Pointer to the variable to store the read value in. |
[in] | endianess | Parameter describing the endianess of the bitfield to read from. |
Definition at line 644 of file workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
References BitSerializer::_buffer, and BitSerializer::checkForInvalidArguments().
Referenced by ddl::codec::detail::readBits().
|
inline |
Write value to bitfield.
Value can be of type tFloat or an unsigned or signed integer.
....|...*****|********|**......|.... Buffer (index 0 on the right end side) |_______________| bit_length ^ | start_bit
[in] | start_bit | Bit position to start writing to. The least significant bit has the index 0. |
[in] | bit_length | Number of bits to write. |
[out] | value | Value to write to the bitfield. |
[in] | endianess | Parameter describing the endianess of the bitfield to write to. |
Definition at line 675 of file workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
References BitSerializer::_buffer, and BitSerializer::checkForInvalidArguments().
Referenced by ddl::codec::detail::writeBits().