Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/afsmPublic

Transition Actions

Sergei Fedorov edited this pageNov 20, 2016 ·1 revision

A transition action is a functor that will be called after the transition's source state exited and before the target state entered. It is passed the event, immediately enclosing state machine and source and target states. The operator can be const-qualified, it doesn't make any difference as the transition action objects are temporaries instantiated at the point of call.

Generic transition action (catch all)

structtransition_action {template<typename Event,typename FSM,typename SourceState,typename TargetState >voidoperator()(Event&&, FSM&, SourceState&, TargetState&)    {using ::psst::util::demangle;        ::std::cerr <<"State machine" << demangle<FSM>()             <<" transits from" << demangle<SourceState>()            <<" to" << demangle<TargetState>()            <<" on event" << demangle<Event>() <<"\n";    }};

The event will be passed by rvalue reference ifprocess_event was called with rvalue reference or the event was previously queued or deferred. TheFSM parameter will be the immediately enclosing state machine (definition wrapped in::afsm::state_machine or::afsm::inner_state_machine. The states parameters are state or state machine definitions wrapped in::afsm::state or::afsm::inner_state_machine respectively.

Source and target state parameters are planned to be optional

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp