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

Event Deferring

Sergei Fedorov edited this pageNov 20, 2016 ·1 revision

Any state or a state machine can declare that it 'defers' an event. That means that the state cannot handle the event straight away, but the event should be saved for processing later, by a state that can handle it. To achieve it, a state or a state machine should define data typedeferred_events that is a type alias for a::psst::meta::type_tuple variadic template containing event types. There istype_tuple type alias inside::afsm::def::state and::afsm::def::state_machine templates.

structmy_state : state<my_state> {using deferred_events = type_tuple< event_a, event_b >;};

Deferred events will be stored by the outermost state machine in deferred queue and they will be checked for processing after each state transition (event handled without a state transition won't provide conditions to process the events). The events will be copied to the event queue. Move construction will be used if applicable.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp