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
Now, when I try to call sm.process_event() with the instance, it does not work:
sm.process_event(e_start); // not working
sm.process_event(e_start()); // working but is ugly and people will forget to add the ()
sm.process_event(start {}); // working
Actual Behavior
Just calling process_event() with the instance doesn't do anything.
Steps to Reproduce the Problem
n/a
Specifications
Version: latest
Platform: macOS
Subsystem: n/a
The text was updated successfully, but these errors were encountered:
I always use sm.process_event(start {}); // working.
You create an instance of the event and pass it on to the state machine. To me this seems like the most natural way to do it. Even more so, once you start adding a payload to an event.
I guess one could implement your wish by adding a special overload of process_event that calls operator() on the front::event<T>. But I think this would only increase complexity for the user.
sml::event is the marker for the library to distinguish events from states/actions, i.e. it's meant to be used for FSM definition.
once FSM defined you should just use your raw events w/o sml's markers. this is similar case as with a definition of template and its actual use, i.e. you don't write template SOME<int> when you need to instantiate it for particular type.
Expected Behavior
As described in the tutorial section, I'm using event instances to simplify the transition table.
Now, when I try to call
sm.process_event()
with the instance, it does not work:Actual Behavior
Just calling
process_event()
with the instance doesn't do anything.Steps to Reproduce the Problem
n/a
Specifications
The text was updated successfully, but these errors were encountered: