MCPcopy Create free account
hub / github.com/boost-ext/sml / operator()

Function operator()

example/dispatch_table.cpp:28–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27struct dispatch_table {
28 auto operator()() noexcept {
29 using namespace sml;
30 // clang-format off
31 return make_transition_table(
32 *"idle"_s + event<event1> = "s1"_s
33 , "s1"_s + event<event2> = X
34 );
35 // clang-format on
36 }
37};
38} // namespace
39
40int main() {
41 sml::sm<dispatch_table> sm;
42
43 auto dispatch_event = sml::utility::make_dispatch_table<runtime_event, 1 /*min*/, 5 /*max*/>(sm);
44
45 {
46 runtime_event event{1};
47 dispatch_event(event, event.id);
48 }
49
50 {
51 runtime_event event{2};
52 dispatch_event(event, event.id);
53 }
54
55 assert(sm.is(sml::X));
56}

Callers

nothing calls this directly

Calls 3

make_transition_tableFunction · 0.85
isMethod · 0.80
mainFunction · 0.70

Tested by

no test coverage detected