MCPcopy Create free account
hub / github.com/boost-ext/sml / process_event

Method process_event

include/boost/sml.hpp:2023–2043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021 }
2022 template <class TEvent, class TDeps, class TSubs>
2023 constexpr bool process_event(const TEvent &event, TDeps &d, TSubs &subs) {
2024 const auto lock = thread_safety_.create_lock();
2025 (void)lock;
2026 bool changed = false;
2027 state_t old[regions]{};
2028 for (auto i = 0u; i < regions; ++i) old[i] = current_state_[i];
2029 bool handled = process_internal_events(event, d, subs);
2030 bool queued_handled = true;
2031 do {
2032 do {
2033 while (process_internal_events(anonymous{}, d, subs)) {
2034 }
2035 changed = false;
2036 for (auto i = 0u; i < regions; ++i) {
2037 if (old[i] != current_state_[i]) { changed = true; break; }
2038 }
2039 for (auto i = 0u; i < regions; ++i) old[i] = current_state_[i];
2040 } while (process_defer_events(d, subs, changed, aux::type_wrapper<defer_queue_t<TEvent>>{}, events_t{}));
2041 } while (process_queued_events(d, subs, queued_handled, aux::type_wrapper<process_queue_t<TEvent>>{}, events_t{}));
2042 return handled && queued_handled;
2043 }
2044 // flush_queue — drain events left in the process queue (#456). process_event
2045 // already drains its own queue before returning; this is for events pushed
2046 // *after* it returned, e.g. from an async callback holding a back::process<>

Callers

nothing calls this directly

Calls 1

create_lockMethod · 0.45

Tested by

no test coverage detected