-
Notifications
You must be signed in to change notification settings - Fork 23
History
Sergei Fedorov edited this page Nov 20, 2016
·
1 revision
By default all states and state machines get 'cleared' after exit. Technically the state objects are default-constructed and assigned to existing objects after next state has been entered. Move assignment will be used if applicable.
To avoid such behavior and store state between exit and enter a state should declare it has history. To do so, a tag ::afsm::tags::has_history
should be used.
If a state has complex and costly construction and/or assignment, an exit action can be used to clear the state and the history tag can be used to prohibit the reconstruction of the state. It can improve performance with complex states.
struct my_state : state<my_state, ::afsm::tags::has_history> {
};
- Home
- Tutorial
-
Concepts
- State Hierarchy
- Entry/Exit Actions
- Transition Actions
- Transition Guards
- Internal Transitions
- Default Transitions
- Event Deferring
- History
- Orthogonal Regions
- Event Priority
- Common Base
- Thread Safety
- Exception Safety Guarantees
- Under the Hood
- Event Processing
- Performance