Skip to content

Advanced Transition Payloads

Andrew Gresyk edited this page Apr 2, 2022 · 2 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 = hfsm2::Config
                        ::PayloadT<T>;
    
    using M = hfsm2::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