Skip to content

Advanced Transition Payloads

Andrew Gresyk edited this page Apr 1, 2022 · 4 revisions

Transition Payloads

  1. Transitions can have payloads.

  2. Only one payload type can be set for the entire FSM instance.

  3. Payload versions of transition methods accept either const or rvalue references.

Tests

  1. Set payload type:

    using Config = ffsm2::Config
                        ::PayloadT<T>;
    
    using M = ffsm2::MachineT<Config>;

Instance and FullControl / GuardControl methods

Method Description
void Plan::changeWith(const StateID, const Payload&);
void Plan::changeWith<TOrigin>(const Payload&);
Default transition
with const payload
void Plan::changeWith(const StateID, Payload&&);
void Plan::changeWith<TOrigin>(Payload&&);
Default transition
with moved payload