33 : _stride(pEnd>
pStart ? stride_inc : stride_dec)
35 , _pEnd(pEnd + _stride)
60 return _pStart == _pEnd;
76 static constexpr int8_t stride_inc = 1;
77 static constexpr int8_t stride_dec = -1;
84#define TABLE3D_TYPENAME_AXIS(size, domain) table3d ## size ## domain ## _axis
86#define TABLE3D_GEN_AXIS(size, dom) \
88 struct TABLE3D_TYPENAME_AXIS(size, dom) { \
90 static constexpr table3d_dim_t length = (size); \
92 static constexpr axis_domain domain = axis_domain_ ## dom; \
96 table3d_axis_t axis[(size)]; \
99 table_axis_iterator begin(void) \
101 return table_axis_iterator(axis+(size)-1, axis, domain); \
104 table_axis_iterator rbegin(void) \
106 return table_axis_iterator(axis, axis+(size)-1, domain); \
111TABLE3D_GEN_AXIS(6,
Rpm)
112TABLE3D_GEN_AXIS(6,
Load)
113TABLE3D_GEN_AXIS(4,
Rpm)
114TABLE3D_GEN_AXIS(4,
Load)
115TABLE3D_GEN_AXIS(8,
Rpm)
116TABLE3D_GEN_AXIS(8,
Load)
117TABLE3D_GEN_AXIS(8,
Tps)
118TABLE3D_GEN_AXIS(16,
Rpm)
119TABLE3D_GEN_AXIS(16,
Load)
Iterate over table axis elements.
Definition table3d_axes.h:28
bool at_end(void) const
Test for end of iteration.
Definition table3d_axes.h:58
table3d_axis_t & operator*(void)
Dereference the iterator.
Definition table3d_axes.h:64
table_axis_iterator & operator++(void)
Increment the iterator by one element.
Definition table3d_axes.h:52
table_axis_iterator & advance(int8_t steps)
Advance the iterator.
Definition table3d_axes.h:45
axis_domain get_domain(void) const
Definition table3d_axes.h:40
const table3d_axis_t & operator*(void) const
Dereference the iterator.
Definition table3d_axes.h:69
table_axis_iterator(table3d_axis_t *pStart, const table3d_axis_t *pEnd, axis_domain domain)
Construct.
Definition table3d_axes.h:32
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition bit_shifts.h:349
Tps
Definition table3d.h:104
int16_t table3d_axis_t
The type of each axis value.
Definition table3d_typedefs.h:28
Rpm
Definition table3d.h:104
axis_domain
Encodes the real world measurement that a table axis captures.
Definition table3d_axes.h:17
Load
Definition table3d.h:104
@ axis_domain_Rpm
Definition table3d_axes.h:19
@ axis_domain_Tps
Definition table3d_axes.h:23
@ axis_domain_Load
Definition table3d_axes.h:21
Typedefs for primitive 3D table elements.