![]() |
IOLink 1.16.1
|
A look-up table. More...
#include <iolink/LookUpTable.h>
Public Member Functions | |
| LookUpTable () | |
| Build an empty look-up table. | |
| LookUpTable (DataType dtype, size_t count) | |
| Build an uninitialized look-up table. | |
| LookUpTable (DataType dtype, const void *src, size_t count) | |
| Build a new Look Up Table object. | |
| template<typename T > | |
| LookUpTable (std::initializer_list< T > init) | |
| Build a look-up table from an initializer list. | |
| template<typename InputIt > | |
| LookUpTable (InputIt first, InputIt last) | |
| Build a look-up table from an iterator. | |
| LookUpTable (const LookUpTable &other) | |
| LookUpTable & | operator= (const LookUpTable &other) |
| LookUpTable (LookUpTable &&other) noexcept | |
| LookUpTable & | operator= (LookUpTable &&other) noexcept |
| DataType | dtype () const |
| Get the data type of the look-up table. | |
| size_t | count () const |
| Get the number of values in the look-up table. | |
| void | read (size_t offset, void *dst, size_t count) const |
| Read data from the look-up table. | |
| template<typename T > | |
| T | at (size_t index) const |
| Read a single value from the look-up table. | |
| size_t | bufferSize () const |
| Get the size of the internal buffer in bytes. | |
| void * | buffer () |
| Get a pointer to the internal buffer. | |
| const void * | buffer () const |
| Get a pointer to the internal buffer. | |
A look-up table.
A read only look-up table consisting of a data type, a number of elements, and a buffer of data.
| iolink::LookUpTable::LookUpTable | ( | DataType | dtype, |
| size_t | count | ||
| ) |
Build an uninitialized look-up table.
| dtype | The data type of the look-up table. |
| count | The number of values in the look-up table. |
| iolink::LookUpTable::LookUpTable | ( | DataType | dtype, |
| const void * | src, | ||
| size_t | count | ||
| ) |
Build a new Look Up Table object.
| dtype | The data type of the look-up table. |
| src | The source buffer to copy data from. |
| count | The number of values in the look-up table. |
|
inline |
Build a look-up table from an initializer list.
The type of the LookUpTable will be inferred from the type of the initializer list. A list of vectors will produce a LUT of vectors, and a list of scalars will produce a LUT of scalars.
| T | The type of the initializer list, from which the look-up table will be inferred. |
| init | The initializer list to build the look-up table from. |
|
inline |
Build a look-up table from an iterator.
The type of the LUT will be inferred from the type of the given iterator.
| InputIt | The iterator type. |
| first | The first iterator. |
| last | The last iterator. |
|
inline |
Read a single value from the look-up table.
| T | The type of the value to read. |
| index | The index of the value to read. |
| InvalidArgument | When the index is out of bounds. |
| void iolink::LookUpTable::read | ( | size_t | offset, |
| void * | dst, | ||
| size_t | count | ||
| ) | const |
Read data from the look-up table.
| offset | The offset in elements from the beginning of the look-up table. |
| dst | The destination buffer, where read data will be written. |
| count | The number of elements to read. |
| InvalidArgument | When the band of data to read is out of bounds. |