Skip to content

Commit

Permalink
datatypes.fsm: cleanup notices for fsm.v
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Dec 20, 2023
1 parent 94d2881 commit 5306469
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions vlib/datatypes/fsm/fsm.v
Expand Up @@ -4,17 +4,24 @@ pub type EventHandlerFn = fn (receiver voidptr, from string, to string)

pub type ConditionFn = fn (receiver voidptr, from string, to string) bool

fn dummy_event_handler_fn(receiver voidptr, from string, to string) {
}

fn dummy_condition_fn(receiver voidptr, from string, to string) bool {
return true
}

struct State {
mut:
entry_handler EventHandlerFn
run_handler EventHandlerFn
exit_handler EventHandlerFn
entry_handler EventHandlerFn = dummy_event_handler_fn
run_handler EventHandlerFn = dummy_event_handler_fn
exit_handler EventHandlerFn = dummy_event_handler_fn
}

struct Transition {
mut:
to string
condition_handler ConditionFn = unsafe { nil }
condition_handler ConditionFn = dummy_condition_fn
}

pub struct StateMachine {
Expand Down

0 comments on commit 5306469

Please sign in to comment.