Skip to content

Added "any state" feature #602

Merged
kris-jusiak merged 1 commit intoboost-ext:masterfrom
rvdvvdw:any_state
Oct 11, 2023
Merged

Added "any state" feature #602
kris-jusiak merged 1 commit intoboost-ext:masterfrom
rvdvvdw:any_state

Conversation

@rvdvvdw
Copy link
Contributor

@rvdvvdw rvdvvdw commented Oct 11, 2023

Allowing a default reaction on events without having to add them to every state.
I believe a similar feature exists in sml2

Problem:
-Many (of my) state machines have events that are handled in (almost) all states. For example, transitions to an error state or a stop/abort event. Currently there is no way to express a default reaction to an event.

Solution:
-Added an "any" state. The any state is written as "state<>". Whenever an event is processed in a state that does NOT handle that event, the "any" state is checked. If the "any" state handles the event it is processed as if the current state is the "any" state. This change could break code that already uses "state<>" as a normal state.

Issue: #328

Reviewers:
@krzysztof-jusiak

@kris-jusiak kris-jusiak merged commit 07d1590 into boost-ext:master Oct 11, 2023
@rvdvvdw rvdvvdw deleted the any_state branch October 12, 2023 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants