File indexing completed on 2025-06-30 08:20:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_MSM_FRONT_STATES_H
0012 #define BOOST_MSM_FRONT_STATES_H
0013
0014 #include <boost/mpl/bool.hpp>
0015 #include <boost/mpl/vector.hpp>
0016 #include <boost/mpl/transform.hpp>
0017
0018 #include <boost/fusion/include/vector.hpp>
0019 #include <boost/fusion/include/make_vector.hpp>
0020
0021 #include <boost/msm/front/common_states.hpp>
0022 #include <boost/msm/row_tags.hpp>
0023
0024
0025 namespace boost { namespace msm { namespace front
0026 {
0027
0028
0029 template <class Event>
0030 struct transform_to_end_interrupt
0031 {
0032 typedef boost::msm::EndInterruptFlag<Event> type;
0033 };
0034
0035 template <class Events>
0036 struct apply_end_interrupt_flag
0037 {
0038 typedef typename
0039 ::boost::mpl::transform<
0040 Events,transform_to_end_interrupt< ::boost::mpl::placeholders::_1> >::type type;
0041 };
0042
0043 template <class Event>
0044 struct get_interrupt_events
0045 {
0046 typedef typename ::boost::mpl::eval_if<
0047 ::boost::mpl::is_sequence<Event>,
0048 boost::msm::front::apply_end_interrupt_flag<Event>,
0049 boost::fusion::result_of::make_vector<boost::msm::EndInterruptFlag<Event> > >::type type;
0050 };
0051
0052 template <class Events>
0053 struct build_interrupt_state_flag_list
0054 {
0055 typedef ::boost::fusion::vector<boost::msm::InterruptedFlag> first_part;
0056 typedef typename ::boost::fusion::result_of::as_vector<
0057 typename ::boost::fusion::result_of::insert_range<
0058 first_part,
0059 typename ::boost::fusion::result_of::end< first_part >::type,
0060 Events
0061 >::type
0062 >::type type;
0063 };
0064
0065 struct no_sm_ptr
0066 {
0067
0068 typedef ::boost::mpl::bool_<false> needs_sm;
0069 };
0070 struct sm_ptr
0071 {
0072
0073 typedef ::boost::mpl::bool_<true> needs_sm;
0074 };
0075
0076 struct NoSMPtr
0077 {
0078
0079 typedef ::boost::mpl::bool_<false> needs_sm;
0080 };
0081 struct SMPtr
0082 {
0083
0084 typedef ::boost::mpl::bool_<true> needs_sm;
0085 };
0086
0087
0088
0089 template<class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
0090 struct state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
0091 {
0092
0093
0094 typedef ::boost::fusion::vector0<> flag_list;
0095 typedef ::boost::fusion::vector0<> internal_flag_list;
0096
0097 typedef ::boost::fusion::vector0<> deferred_events;
0098 };
0099
0100
0101
0102 template<class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
0103 struct terminate_state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
0104 {
0105
0106 typedef ::boost::fusion::vector0<> flag_list;
0107 typedef ::boost::fusion::vector< boost::msm::TerminateFlag> internal_flag_list;
0108
0109 typedef ::boost::fusion::vector0<> deferred_events;
0110 };
0111
0112
0113
0114
0115 template <class EndInterruptEvent,class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
0116 struct interrupt_state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
0117 {
0118
0119 typedef ::boost::fusion::vector0<> flag_list;
0120 typedef typename boost::msm::front::build_interrupt_state_flag_list<
0121 typename boost::msm::front::get_interrupt_events<EndInterruptEvent>::type
0122 >::type internal_flag_list;
0123
0124
0125 typedef ::boost::fusion::vector0<> deferred_events;
0126 };
0127
0128
0129
0130 template <int ZoneIndex=-1>
0131 struct explicit_entry
0132 {
0133 typedef int explicit_entry_state;
0134 enum {zone_index=ZoneIndex};
0135 };
0136
0137
0138
0139
0140
0141 template<int ZoneIndex=-1,class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
0142 struct entry_pseudo_state
0143 : public boost::msm::front::detail::state_base<BASE>,SMPtrPolicy
0144 {
0145
0146 typedef int pseudo_entry;
0147 enum {zone_index=ZoneIndex};
0148 typedef int explicit_entry_state;
0149
0150 typedef ::boost::fusion::vector0<> flag_list;
0151 typedef ::boost::fusion::vector0<> internal_flag_list;
0152
0153 typedef ::boost::fusion::vector0<> deferred_events;
0154 };
0155
0156
0157
0158
0159 template<class Event,class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
0160 struct exit_pseudo_state : public boost::msm::front::detail::state_base<BASE> , SMPtrPolicy
0161 {
0162 typedef Event event;
0163 typedef BASE Base;
0164 typedef SMPtrPolicy PtrPolicy;
0165 typedef int pseudo_exit;
0166
0167
0168 typedef ::boost::fusion::vector0<> flag_list;
0169 typedef ::boost::fusion::vector0<> internal_flag_list;
0170
0171 typedef ::boost::fusion::vector0<> deferred_events;
0172 };
0173
0174 }}}
0175
0176 #endif
0177