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

Overview Minimal Example

Andrew Gresyk edited this pageApr 1, 2022 ·3 revisions

Minimal Example

Tests

Code

#include<assert.h>#include<ffsm2/machine.hpp>structContext {bool on =false;};using Config = ffsm2::Config                    ::ContextT<Context&>;using M = ffsm2::MachineT<Config>;using FSM = M::PeerRoot<structOff,structOn            >;structOff    : FSM::State{voidenter(PlanControl& control) {        control.context().on =false;    }};structOn    : FSM::State{voidenter(PlanControl& control) {        control.context().on =true;    }};intmain() {    Context context;    FSM::Instance machine{context};    machine.changeTo<On>();    machine.update();assert(context.on ==true);return0;}
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp