ADTF
|
Converter Base Contains the base methods used by all inheriting Converter classes. More...
Static Protected Member Functions | |
static tResult | ReadSignal (tUInt8 *pBuffer, tSize nStartBit, tSize nBitLength, T *pValue, tInt nEndianess=PLATFORM_BYTEORDER) |
Read value from bitfield. More... | |
static tResult | WriteSignal (tUInt8 *pBuffer, tSize nStartBit, tSize nBitLength, T nValue, tInt nEndianess=PLATFORM_BYTEORDER) |
Write value to bitfield. More... | |
static tResult | CutLeadingBits (tUInt64 *pValue, tSize nBitLength) |
Set the highest bits of a tUInt64 value to zero. More... | |
static tResult | CopyBytesFromBuffer (tUInt8 *pBuffer, tUInt64 *pValue, tSize nStartBit, tSize nBitLength, tUInt64 *pNinthByte, tSize *pBytesToRead) |
Copy pBytesToRead number of bytes from the buffer to pValue and pNinthByte. More... | |
Converter Base Contains the base methods used by all inheriting Converter classes.
Definition at line 51 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
|
inlinestaticprotected |
Copy pBytesToRead number of bytes from the buffer to pValue and pNinthByte.
Determines how many bytes need to be copied to receive a copy of all bits in the range described by nStartBit and nBitLength. The maximum for nBitLength is 64, but for unaligned values the range may exceed 8 bytes. In this case, the required ninth byte will be copied to pNinthByte.
[in] | pBuffer | Pointer to the memory buffer to copy from. |
[out] | pValue | Pointer to the variable to store the copied value in. |
[in] | nStartBit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | nBitLength | Number of bits to read. |
[out] | pNinthByte | Pointer to the variable to eventually store a copied ninth byte in. |
[out] | pBytesToRead | Number of bytes that need to be copied to attain all requested bits. |
Definition at line 387 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References cMemoryBlock::MemCopy(), and RETURN_NOERROR.
Referenced by ConverterBase< T >::ReadSignal(), and ConverterBase< T >::WriteSignal().
Set the highest bits of a tUInt64 value to zero.
The number of nBitLength lowest bits remain unchanged.
[out] | pValue | Pointer to the variable to trim. |
[in] | nBitLength | Number of trailing bits to remain unchanged. |
Definition at line 358 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References RETURN_NOERROR.
Referenced by ConverterBase< T >::ReadSignal(), and ConverterBase< T >::WriteSignal().
|
inlinestaticprotected |
Read value from bitfield.
Operating on a tUInt64 copy to allow bit shifting and masking operations.
[in] | pBuffer | Pointer to the memory buffer to read from. |
[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 71 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References ConverterBase< T >::CopyBytesFromBuffer(), ConverterBase< T >::CutLeadingBits(), cMemoryBlock::MemCopy(), PLATFORM_BIG_ENDIAN_8, PLATFORM_BYTEORDER, PLATFORM_LITTLE_ENDIAN_8, and RETURN_NOERROR.
Referenced by Converter< T, 0, 0 >::Read(), and Converter< T, 1, 1 >::Read().
|
inlinestaticprotected |
Write value to bitfield.
Operating on a tUInt64 copy to allow bit shifting and masking operations.
[in] | pBuffer | Pointer to the memory buffer to write to. |
[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 261 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/bitserializer.h.
References ConverterBase< T >::CopyBytesFromBuffer(), ConverterBase< T >::CutLeadingBits(), cMemoryBlock::MemCopy(), PLATFORM_BIG_ENDIAN_8, and RETURN_NOERROR.
Referenced by Converter< T, 0, 0 >::Write(), Converter< T, 1, 0 >::Write(), and Converter< T, 1, 1 >::Write().