39 template <
class state_type_t>
49 template <
class state_type_t>
59 stateval = (state_type_t *) malloc (size);
66 template <
class state_type_t>
69 if (stateval)
free (stateval);
74 template <
class state_type_t>
77 if (stateval != NULL)
free (stateval);
80 stateval = (state_type_t *)
81 calloc (nstates,
sizeof (state_type_t) *
STATE_NUM);
87 template <
class state_type_t>
90 if (nstates && stateval)
91 memset (stateval, 0, nstates *
sizeof (state_type_t) *
STATE_NUM);
98 template <
class state_type_t>
108 template <
class state_type_t>
116 template <
class state_type_t>
119 if (--currentstate < 0) currentstate =
STATE_NUM - 1;
123 template <
class state_type_t>
126 currentstate = (currentstate + 1) &
STATE_MASK;
131 template <
class state_type_t>
135 state_type_t * p = &stateval[state <<
STATE_SHIFT];
145 template <
class state_type_t>
152 values[
i] = getState (state,
i);
158 template <
class state_type_t>
165 setState (state, values[
i], i);
void fillState(int, state_type_t)
template class for storing state variables.
state_type_t getState(int, int n=0)
void saveState(int, state_type_t *)
void inputState(int, state_type_t *)
void setState(int, state_type_t, int n=0)