Provides packed access to fixed-width unsigned values stored in a byte span.
More...
#include <bit_utils.h>
|
| void | set (uint32_t bitPosition, uint8_t value) noexcept |
| | Stores a packed value at the specified bit position.
|
| |
| uint8_t | get (uint32_t bitPosition) const noexcept |
| | Reads a packed value from the specified bit position.
|
| |
|
|
std::span< uint8_t > | m_data |
| | Bytes containing the packed values.
|
| |
|
|
static constexpr uint32_t | MaxValue = (1 << BlockBits) - 1 |
| | Largest value representable by one packed block.
|
| |
template<uint32_t BlockBits>
struct gaia::core::bit_view< BlockBits >
Provides packed access to fixed-width unsigned values stored in a byte span.
- Template Parameters
-
| BlockBits | Number of bits occupied by each value. |
◆ get()
template<uint32_t BlockBits>
Reads a packed value from the specified bit position.
- Parameters
-
| bitPosition | Bit offset of the value within m_data. |
- Returns
- The decoded value.
◆ set()
template<uint32_t BlockBits>
Stores a packed value at the specified bit position.
- Parameters
-
| bitPosition | Bit offset of the value within m_data. |
| value | Value to store. It must not exceed MaxValue. |
The documentation for this struct was generated from the following file:
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/core/bit_utils.h