9 #define STATE_MNG_SUCCESS (0) 10 #define STATE_MNG_FAILED (-1) 24 #define STATE_MNG_SET_INFO_INIT(instate, fname) {.state=(instate), .name=#fname, .state_method = (fname)} 28 #define STATE_MNG_SET_INFO(info, instate, fname) {(info).state=(instate); (info).name=#fname; (info).state_method = (fname) ; } int(* state_method)(void *arg)
name, function name defined by macro.
void state_manager_free(StateManager this)
free StateManager class
StateManager class member definition, detail is defined in C file.
struct state_info_t state_info_t
void state_manager_set_state(StateManager this, int state)
set state
int state_manager_get_current_state(StateManager this)
get current state
int state_manager_update_method(StateManager this, const state_info_t *state)
update method related to state
int state_manager_call(StateManager this, void *arg)
call state method
struct state_manager_t * StateManager
StateManager class definition, to management state.
void state_manager_show(StateManager this)
show current state table
StateManager state_manager_new(size_t state_info_num, const state_info_t *state)
Create StateManager class.
char * name
state value related function
state method definition, to know detail, add parameter "name".