#include <bitserializer.h>
Inherited by a_util::memory::detail::Converter< T, 0, 0 >, a_util::memory::detail::Converter< T, 1, 0 >, and a_util::memory::detail::Converter< T, 1, 1 >.
|
| static a_util::result::Result | readSignal (uint8_t *buffer, size_t start_bit, size_t bit_length, T *value, Endianess endianess=get_platform_endianess()) |
| |
| static a_util::result::Result | writeSignal (uint8_t *buffer, size_t start_bit, size_t bit_length, T value, Endianess endianess=get_platform_endianess()) |
| |
| static a_util::result::Result | cutLeadingBits (uint64_t *value, size_t bit_length) |
| |
| static a_util::result::Result | copyBytesFromBuffer (uint8_t *buffer, uint64_t *value, size_t start_bit, size_t bit_length, uint64_t *ninth_byte, size_t *bytes_to_read) |
| |
template<typename T>
class a_util::memory::detail::ConverterBase< T >
Converter Base Contains the base methods used by all inheriting Converter classes.
◆ copyBytesFromBuffer()
Copy bytes_to_read number of bytes from the buffer to value and ninth_byte. Determines how many bytes need to be copied to receive a copy of all bits in the range described by start_bit and bit_length. The maximum for bit_length is 64, but for unaligned values the range may exceed 8 bytes. In this case, the required ninth byte will be copied to ninth_byte.
- Parameters
-
| [in] | buffer | Pointer to the memory buffer to copy from. |
| [out] | value | Pointer to the variable to store the copied value in. |
| [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] | ninth_byte | Pointer to the variable to eventually store a copied ninth byte in. |
| [out] | bytes_to_read | Number of bytes that need to be copied to attain all requested bits. |
- Returns
- Returns a standard result code.
◆ cutLeadingBits()
Set the highest bits of a uint64_t value to zero. The number of bit_length lowest bits remain unchanged.
- Parameters
-
| [out] | value | Pointer to the variable to trim. |
| [in] | bit_length | Number of trailing bits to remain unchanged. |
- Returns
- Returns a standard result code.
◆ readSignal()
Read value from bitfield. Operating on a uint64_t copy to allow bit shifting and masking operations.
- Parameters
-
| [in] | buffer | Pointer to the memory buffer to read from. |
| [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. |
- Returns
- Returns a standard result code.
◆ writeSignal()
Write value to bitfield. Operating on a uint64_t copy to allow bit shifting and masking operations.
- Parameters
-
| [in] | buffer | Pointer to the memory buffer to write to. |
| [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. |
- Returns
- Returns a standard result code.
The documentation for this class was generated from the following file:
- /workspace/conan/dev_essential/1.6.3/dw/stable/package/65324bff46e457721a7ba250afe9d61dc2b0e57a/include/ddl/codec/bitserializer.h