-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for exception handling #33
Comments
Could it be done in a possibly optional manner that won't enforce exception support as requirement? Right now the library is about the only one useful on small embedded systems (where |
Actually, exception handling is done already The only thing related to this issue which is left is the relation between which state should be active when exception is thrown., so, no worries @Ulenspiegel, exceptions are only supported in case when they are enabled. In case of '-fnoexceptions' exception handling code is ignored. For me, it's really important to keep msm 'lite' and as easy to use as possible on embedded systems. Example "state1"_s + exception<std::out_of_range> [guard] / action = "s2"_s Thank you @Ulenspiegel for a valid point though. |
That's just splendid; thank you for clearing things out. :) And for the library - a godsend, especially for constrained systems. |
This one is working as expected. Tests here -> https://github.com/boost-experimental/msm-lite/blob/master/test/ft/ft_exceptions.cpp. Closing it. |
The code in guards and transitions can throw exceptions that should be transformed in events by the state machine engine. These exception events must be managed just after the exception is caught.
An exception throw in a guard should left the sm in the current state.
An exception throw in an action should left the sm in the nesting state of the source state for external and local transitions and the current state for internal transitions.
The text was updated successfully, but these errors were encountered: