You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return value of process_event is already nice to determine if an event has been processed or silently dropped.
boolsm::process_event(event)
When working with user interfaces though, you would like to know upfront what events are currently possible (to grey impossible ones out).
Is there a way to iterate over currently possible events?
sm.visit_current_events([](auto& event){ })
or have a way to test specific events without calling the action?
boolsm::can_process_event(event)
The latter could be achieved with same shared context and guards that would block if you are currently in "query mode". I am just wondering if there could be a reusable way of implementing it, without overloading all guards.
So an implementation of can_process_event could call this function with another template parameter, that would prevent calling the action a (call<TEvent, args_t<A, TEvent>,), whereas a call through process_event would allow it.
The text was updated successfully, but these errors were encountered:
The return value of
process_event
is already nice to determine if an event has been processed or silently dropped.When working with user interfaces though, you would like to know upfront what events are currently possible (to grey impossible ones out).
Is there a way to iterate over currently possible events?
sm.visit_current_events([](auto& event){ })
or have a way to test specific events without calling the action?
The latter could be achieved with same shared context and guards that would block if you are currently in "query mode". I am just wondering if there could be a reusable way of implementing it, without overloading all guards.
Edit: I did some digging and found
sml/include/boost/sml.hpp
Lines 2558 to 2564 in 58536b9
So an implementation of
can_process_event
could call this function with another template parameter, that would prevent calling the actiona
(call<TEvent, args_t<A, TEvent>,
), whereas a call throughprocess_event
would allow it.The text was updated successfully, but these errors were encountered: