30 : pValue(pRowStart), pEnd(pRowStart+rowWidth)
46 pValue = pValue + steps;
59 return pValue == pEnd;
96 : pRowsStart(pValues),
138 return _row == rowWidth;
147#define TABLE3D_TYPENAME_VALUE(size, xDom, yDom) CONCAT(TABLE3D_TYPENAME_BASE(size, xDom, yDom), _values)
149#define TABLE3D_GEN_VALUES(size, xDom, yDom) \
151 struct TABLE3D_TYPENAME_VALUE(size, xDom, yDom) { \
153 static constexpr table3d_dim_t row_size = (size); \
155 static constexpr table3d_dim_t num_rows = (size); \
157 table3d_value_t values[(uint16_t)row_size*num_rows]; \
160 table_value_iterator begin(void) \
162 return table_value_iterator(values, row_size); \
166 table3d_value_t& value_at(table3d_dim_t linear_index) \
168 return values[linear_index]; \
171TABLE3D_GENERATOR(TABLE3D_GEN_VALUES)
Iterate through a table row. I.e. constant Y, changing X.
Definition table3d_values.h:21
const table3d_value_t * end(void) const
Pointer to the end of the row.
Definition table3d_values.h:36
table_row_iterator & operator++(void)
Increment the iterator by one element.
Definition table3d_values.h:51
table_row_iterator(const table3d_value_t *pRowStart, table3d_dim_t rowWidth)
Construct.
Definition table3d_values.h:29
table3d_value_t * end(void)
Pointer to the end of the row.
Definition table3d_values.h:38
table3d_dim_t size(void) const
Number of elements available.
Definition table3d_values.h:76
table_row_iterator & advance(table3d_dim_t steps)
Advance the iterator.
Definition table3d_values.h:44
table3d_value_t & operator*(void)
Dereference the iterator.
Definition table3d_values.h:69
const table3d_value_t & operator*(void) const
Dereference the iterator.
Definition table3d_values.h:64
bool at_end(void) const
Test for end of iteration.
Definition table3d_values.h:57
Iterate through a tables values, row by row.
Definition table3d_values.h:87
table_row_iterator operator*(void)
Dereference the iterator to access a row of data.
Definition table3d_values.h:130
table_row_iterator operator*(void) const
Dereference the iterator to access a row of data.
Definition table3d_values.h:125
table_value_iterator & operator++(void)
Increment the iterator by one row.
Definition table3d_values.h:119
table_value_iterator(const table3d_value_t *pValues, table3d_dim_t axisSize)
Construct.
Definition table3d_values.h:95
table_value_iterator & advance(table3d_dim_t rows)
Advance the iterator.
Definition table3d_values.h:112
bool at_end(void) const
Test for end of iteration.
Definition table3d_values.h:136
uint8_t table3d_value_t
The type of each table value.
Definition table3d_typedefs.h:25
uint8_t table3d_dim_t
Encodes the length of the axes.
Definition table3d_typedefs.h:22
Typedefs for primitive 3D table elements.