ADTF
3.18.5
|
Bit Serializer Class. More...
Public Member Functions | |
cBitSerializer (cMemoryBlock *pMemoryBlock) | |
Constructor. | |
cBitSerializer (tVoid *pData, tSize nDataSize) | |
Constructor. | |
cBitSerializer () | |
Default Constructor. | |
virtual | ~cBitSerializer () |
Destructor. | |
template<typename T > | |
tResult | Read (tSize nStartBit, tSize nBitLength, T *pValue, tInt nEndianess=PLATFORM_BYTEORDER) |
Read value from bitfield. More... | |
template<typename T > | |
tResult | Write (tSize nStartBit, tSize nBitLength, T nValue, tInt nEndianess=PLATFORM_BYTEORDER) |
Write value to bitfield. More... | |
Private Member Functions | |
tResult | CheckForInvalidArguments (tSize nStartBit, tSize nBitLength, tSize nSizeVariable) |
Check if the parameters for the reading and writing access are valid. More... | |
Private Attributes | |
tUInt8 * | m_pBuffer |
internal buffer | |
tSize | m_nBufferBytes |
size of internal buffer in bytes | |
tSize | m_nBufferBits |
size of internal buffer in bits | |
Bit Serializer Class.
Definition at line 611 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/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] | nStartBit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | nBitLength | Number of bits to read. |
[in] | nSizeVariable | Size of the variable to read into or write from. |
Definition at line 753 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References cBitSerializer::m_nBufferBits, cBitSerializer::m_pBuffer, RETURN_ERROR, RETURN_IF_POINTER_NULL, and RETURN_NOERROR.
Referenced by cBitSerializer::Read(), and cBitSerializer::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) |_______________| nBitLength ^ | nStartBit
[in] | nStartBit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | nBitLength | Number of bits to read. |
[out] | pValue | Pointer to the variable to store the read value in. |
[in] | nEndianess | Parameter describing the endianess of the bitfield to read from. PLATFORM_BIG_ENDIAN_8: Bitfield interpreted as Big Endian. PLATFORM_LITTLE_ENDIAN_8: Bitfield interpreted as Little Endian. PLATFORM_BYTEORDER: Endianess can be neglected. |
Definition at line 674 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References cBitSerializer::CheckForInvalidArguments(), cResult::IsFailed(), cBitSerializer::m_pBuffer, and RETURN_NOERROR.
|
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) |_______________| nBitLength ^ | nStartBit
[in] | nStartBit | Bit position to start writing to. The least significant bit has the index 0. |
[in] | nBitLength | Number of bits to write. |
[out] | nValue | Value to write to the bitfield. |
[in] | nEndianess | Parameter describing the endianess of the bitfield to write to. PLATFORM_BIG_ENDIAN_8: Bitfield interpreted as Big Endian. PLATFORM_LITTLE_ENDIAN_8: Bitfield interpreted as Little Endian. PLATFORM_BYTEORDER: Endianess can be neglected. |
Definition at line 713 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References cBitSerializer::CheckForInvalidArguments(), cResult::IsFailed(), cBitSerializer::m_pBuffer, and RETURN_NOERROR.