state_machine_config.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright 2025 Christian Granzin
  2. // Copyright 2008 Christophe Henry
  3. // henry UNDERSCORE christophe AT hotmail DOT com
  4. // This is an extended version of the state machine available in the boost::mpl library
  5. // Distributed under the same license as the original.
  6. // Copyright for the original version:
  7. // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
  8. // under the Boost Software License, Version 1.0. (See accompanying
  9. // file LICENSE_1_0.txt or copy at
  10. // http://www.boost.org/LICENSE_1_0.txt)
  11. #ifndef BOOST_MSM_BACKMP11_STATE_MACHINE_CONFIG_H
  12. #define BOOST_MSM_BACKMP11_STATE_MACHINE_CONFIG_H
  13. #include <deque>
  14. namespace boost::msm::backmp11
  15. {
  16. namespace detail
  17. {
  18. struct config_tag {};
  19. // Check whether a type is a config.
  20. template <class T>
  21. using is_config = std::is_same<typename T::internal::tag, config_tag>;
  22. }
  23. // Config for the default compile policy
  24. // (runtime over compile time).
  25. struct favor_runtime_speed;
  26. // Config for a compile policy,
  27. // which favors compile time over runtime.
  28. struct favor_compile_time;
  29. // Config for the default context parameter
  30. // (no context).
  31. struct no_context {};
  32. // Config for the default root sm parameter
  33. // (no root sm).
  34. struct no_root_sm {};
  35. // Config for the default fsm parameter
  36. // (transition owner)
  37. struct transition_owner{};
  38. // Default state machine config.
  39. struct default_state_machine_config
  40. {
  41. using compile_policy = favor_runtime_speed;
  42. using context = no_context;
  43. using root_sm = no_root_sm;
  44. using fsm_parameter = transition_owner;
  45. template<typename T>
  46. using queue_container = std::deque<T>;
  47. struct internal
  48. {
  49. using tag = detail::config_tag;
  50. };
  51. };
  52. using state_machine_config = default_state_machine_config;
  53. } // boost::msm::backmp11
  54. #endif // BOOST_MSM_BACKMP11_STATE_MACHINE_CONFIG_H