Skip to content

Releases: p-groarke/fea_state_machines

v1.1

25 Apr 20:01
844f126
Compare
Choose a tag to compare

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 and on_exit_to on transitions.
    • For example : add_event<fsm_event::on_enter_from, my_transition::a_transition>(...)
  • 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.
  • 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.
  • 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 or trigger, pass in the object pointer (plus the other arguments).
  • The machine has more checks to make sure you've added all declared states.
  • Contains various assert and throw bug fixes.

v1.0

25 Apr 18:29
4074066
Compare
Choose a tag to compare

Initial release.

The library provides fsm, hfsm and constexpr_fsm. These are in heavy development.