|
HikoGUI
A low latency retained GUI
|
#include <hikogui/container/packed_int_array.hpp>
Public Types | |
| using | value_type |
| The value type of the unsigned integers that are stored in the array. | |
Public Member Functions | |
| template<std::integral... Args> | |
| constexpr | packed_int_array (Args... args) noexcept |
| Constructor of the array. | |
| constexpr size_t | size () const noexcept |
| The number of integers stored in the array. | |
| constexpr value_type | operator[] (size_t i) const noexcept |
| Get the integer at an index. | |
Static Public Attributes | |
| static constexpr size_t | bits_per_integer = BitsPerInteger |
| Number of bits of the unsigned integer. | |
| static constexpr size_t | store_size = ceil(bits_per_integer + CHAR_BIT - 1, size_t{CHAR_BIT}) / size_t{CHAR_BIT} |
| Number of bytes required to hold the number of bits. | |
Friends | |
| template<size_t I> | |
| constexpr value_type | get (packed_int_array const &rhs) noexcept |
| Get the integer at an index. | |
An array of integers.
The integers in the array are tightly packed without padding bits.
| BitsPerInteger | Number of bits of each integer, between 0 and 57. |
| N | The number of integers to store. |
| using v1::packed_int_array< BitsPerInteger, N >::value_type |
The value type of the unsigned integers that are stored in the array.
The size of the unsigned integer type is automatically selected to be the smallest type that can hold BitsPerInteger and can also be aligned/adjusted by up to 7 bits.
|
inlineconstexprnoexcept |
Constructor of the array.
| args | A list of integers. |
|
inlineconstexprnoexcept |
Get the integer at an index.
If possible this function will use load() to do an efficient unaligned load from memory.
| i | An index into the array. |
|
inlineconstexprnoexcept |
The number of integers stored in the array.
|
friend |
Get the integer at an index.
If possible this function will use load() to do an efficient unaligned load from memory.
| I | An index into the array. |
| rhs | The packed int array to read from. |
|
staticconstexpr |
Number of bits of the unsigned integer.
|
staticconstexpr |
Number of bytes required to hold the number of bits.
This needs extra 7 bits for alignment/adjustment.