Releases: p-groarke/fea_state_machines
Releases · p-groarke/fea_state_machines
v1.1
This is an API breaking release.
fsm.hpp
- Gained a finished state and an api to check if the machine is finished.
- Gained an
fsm_builder
, to make creation easier to read and less prone to tendinitis. - You may now specialize
on_enter_from
andon_exit_to
on transitions.- For example :
add_event<fsm_event::on_enter_from, my_transition::a_transition>(...)
- For example :
- The event signature now mimics how you create
std::functions
.- For example :
fea::fsm_builder<my_transitions, my_states, void(bool, int)>
- This makes it much easier to read and understand.
- For example :
- You may now return values from the
update
call.- For example :
fea::fsm_builder<my_transitions, my_states, int(bool, int)>
- If you use this feature, I'd like to know if you think other events should also be forced to return values.
- For example :
- The machine reference is now passed in as the last argument to your callback, instead of the first.
- This was changed to allow support for member function callbacks.
- The machine now supports member function callbacks.
- When using member function callbacks, add an object pointer as the first argument to your callback, like you would with
std::function
. - For example :
fea::fsm_builder<my_transitions, my_states, void(MyObj*, bool, int)>
- Then, add events using references to your member function pointer :
add_event<fsm_event::on_enter>(&MyObj::my_enter_func)
- When calling
update
ortrigger
, pass in the object pointer (plus the other arguments).
- When using member function callbacks, add an object pointer as the first argument to your callback, like you would with
- The machine has more checks to make sure you've added all declared states.
- Contains various
assert
andthrow
bug fixes.