Dev Essential  1.6.3
Loading...
Searching...
No Matches
a_util::memory::BitSerializer Class Reference

Bit Serializer Class. More...

#include <bitserializer.h>

Public Member Functions

 BitSerializer (void *data, size_t data_size)
 
 BitSerializer ()
 
template<typename T>
a_util::result::Result read (size_t start_bit, size_t bit_length, T *value, Endianess endianess=get_platform_endianess())
 
template<typename T>
a_util::result::Result write (size_t start_bit, size_t bit_length, T value, Endianess endianess=get_platform_endianess())
 

Detailed Description

Bit Serializer Class.

Constructor & Destructor Documentation

◆ BitSerializer() [1/2]

a_util::memory::BitSerializer::BitSerializer ( void * data,
size_t data_size )
inline

Constructor

◆ BitSerializer() [2/2]

a_util::memory::BitSerializer::BitSerializer ( )
inline

Default Constructor

Member Function Documentation

◆ read()

template<typename T>
a_util::result::Result a_util::memory::BitSerializer::read ( size_t start_bit,
size_t bit_length,
T * value,
Endianess endianess = get_platform_endianess() )
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

Parameters
[in]start_bitBit position to start reading from. The least significant bit has the index 0.
[in]bit_lengthNumber of bits to read.
[out]valuePointer to the variable to store the read value in.
[in]endianessParameter describing the endianess of the bitfield to read from.
Returns
Returns a standard result code.

◆ write()

template<typename T>
a_util::result::Result a_util::memory::BitSerializer::write ( size_t start_bit,
size_t bit_length,
T value,
Endianess endianess = get_platform_endianess() )
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

Parameters
[in]start_bitBit position to start writing to. The least significant bit has the index 0.
[in]bit_lengthNumber of bits to write.
[out]valueValue to write to the bitfield.
[in]endianessParameter describing the endianess of the bitfield to write to.
Returns
Returns a standard result code.

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