Constructor
DexStateMachinenew
Declaration [src]
DexStateMachine*
dex_state_machine_new (
GType state_enum_type,
guint initial_state,
const DexStateTransition* transitions,
guint n_transitions,
DexScheduler* scheduler,
gsize stack_size,
gpointer user_data,
GDestroyNotify user_data_destroy
)
Description [src]
Creates a new DexStateMachine.
The transition table is copied and validated before the state machine is
returned. Each transition must have a valid from state, valid to state,
and non-NULL callback. Duplicate edges are rejected.
This constructor is not directly available to language bindings.
Parameters
state_enum_type-
Type:
GTypeA
GTypefor aGEnum. initial_state-
Type:
guintThe initial state value.
transitions-
Type: An array of
DexStateTransitionTransition entries.
The length of the array is specified in the n_transitionsargument.The data is owned by the caller of the function. n_transitions-
Type:
guintThe number of transition entries.
scheduler-
Type:
DexSchedulerScheduler to spawn transition fibers on, or
NULLfor the thread default.The argument can be NULL.The data is owned by the caller of the function. stack_size-
Type:
gsizeStack size for transition fibers, or zero to use the default.
user_data-
Type:
gpointerUser data for transition callbacks.
The argument can be NULL.The data is owned by the caller of the function. user_data_destroy-
Type:
GDestroyNotifyDestroy notify for
user_data.The argument can be NULL.
Return value
Type: DexStateMachine
A new DexStateMachine.
| The caller of the function takes ownership of the data, and is responsible for freeing it. |