ValueLimiter

Members

Functions

get
T get(size_t i)
getNorm
T getNorm(size_t i)
set
T set(size_t i, T v)
setNorm
T setNorm(size_t i, T nv)

Properties

maxLimit
T maxLimit [@property getter]
maxLimit
T maxLimit [@property setter]
minLimit
T minLimit [@property getter]
minLimit
T minLimit [@property setter]

Variables

values
T[CNT] values;

Examples

1 auto vh = ValueLimiter!(2,float)();
2 
3 vh.minLimit = 0;
4 vh.maxLimit = 10;
5 
6 vh.set( 0, 5 );
7 vh.set( 1, 7 );
8 
9 assertEq( vh.get(0), 5 );
10 assertEq( vh.get(1), 7 );
11 
12 vh.set(1,3);
13 
14 assertEq( vh.get(0), 3 );
15 assertEq( vh.get(1), 3 );
16 
17 vh.set(1,20);
18 assertEq( vh.get(0), 3 );
19 assertEq( vh.get(1), 10 );

Meta