erikzenker / hsm

Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum.
MIT License
187 stars 18 forks source link

[FEATURE] Provide state information to unexpected event handler #144

Closed erikzenker closed 3 years ago

erikzenker commented 3 years ago

Problem

The unexpected event handler does currently only get the event as an parameter, but the current state is unknown to the handler. Thats makes it harder to debug in which state the unexpected event was triggered.

Proposed Solution

Provide the current state and parent state to the event handler (at least a string representation of it)

erikzenker commented 3 years ago

Could be implemented by providing something similar to the dispatch table e.g.: unexpectedEventHandlerTable, that contains for every event an array that points for every state id to the unexpectedEventHandler with a call operator.

erikzenker commented 3 years ago

Fixed with #157