Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-17 08:50:41

0001 // Copyright 2025 Christian Granzin
0002 // Copyright 2008 Christophe Henry
0003 // henry UNDERSCORE christophe AT hotmail DOT com
0004 // This is an extended version of the state machine available in the boost::mpl library
0005 // Distributed under the same license as the original.
0006 // Copyright for the original version:
0007 // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
0008 // under the Boost Software License, Version 1.0. (See accompanying
0009 // file LICENSE_1_0.txt or copy at
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 
0012 #ifndef BOOST_MSM_BACKMP11_COMMON_TYPES_H
0013 #define BOOST_MSM_BACKMP11_COMMON_TYPES_H
0014 
0015 #include <any>
0016 #include <boost/msm/back/common_types.hpp>
0017 
0018 namespace boost { namespace msm { namespace backmp11
0019 {
0020 
0021 using process_result = back::HandledEnum;
0022 
0023 using any_event = std::any;
0024 
0025 // Selector for the visit mode.
0026 // Can be active_states or all_states in recursive
0027 // or non-recursive mode.
0028 enum class visit_mode
0029 {
0030     // State selection (mutually exclusive).
0031     active_states = 0b001,
0032     all_states    = 0b010,
0033 
0034     // Traversal mode (not set = non-recursive).
0035     recursive     = 0b100,
0036 
0037     // All valid combinations.
0038     active_non_recursive = active_states,
0039     active_recursive     = active_states | recursive,
0040     all_non_recursive    = all_states,
0041     all_recursive        = all_states | recursive
0042 };
0043 constexpr visit_mode operator|(visit_mode lhs, visit_mode rhs)
0044 {
0045     return static_cast<visit_mode>(
0046         static_cast<std::underlying_type_t<visit_mode>>(lhs) |
0047         static_cast<std::underlying_type_t<visit_mode>>(rhs)
0048     );
0049 }
0050 
0051 namespace detail
0052 {
0053 
0054 using EventSource = back::EventSourceEnum;
0055 using back::HandledEnum;
0056 
0057 constexpr EventSource operator|(EventSource lhs, EventSource rhs)
0058 {
0059     return static_cast<EventSource>(
0060         static_cast<std::underlying_type_t<EventSource>>(lhs) |
0061         static_cast<std::underlying_type_t<EventSource>>(rhs)
0062     );
0063 }
0064 
0065 }
0066 
0067 }}} // namespace boost::msm::backmp11
0068 
0069 #endif // BOOST_MSM_BACKMP11_COMMON_TYPES_H