5 #ifndef STATE_MACHINE_H_ 6 #define STATE_MACHINE_H_ state_info_t * state_infos
state list, please see state_manager.h defition
This is API for Sate design pattern.
struct state_machine_info * StateMachineInfo
int state_machine_call_event(StateMachineInfo this, int event, void *arg, int arglen, void(*response)(int result))
call event trigger
This is API as ThreadPool design petten by using libevent.
void state_machine_free(StateMachineInfo this)
free StateMachine class
struct state_machine_info state_machine_info_t
void state_machine_set_state(StateMachineInfo this, int state)
set state
struct state_machine_t * StateMachine
StateMachine class definition.
EventTPoolManager class instance definition.
StateMachine state_machine
int state_machine_get_current_state(StateMachineInfo this)
get state
event ID and related state functions
StateMachine class member definition.
struct state_event_info_t state_event_info_t
StateMachineInfo state_machine_new(size_t event_num, const state_event_info_t *event_infos, EventTPoolManager threadpool)
Create StateMachineInfo class.
void state_machine_show(StateMachineInfo this)
set state
int state_machine_update_machine(StateMachineInfo this, const state_event_info_t *event_info)
update sate
state method definition, to know detail, add parameter "name".
size_t state_num
state num