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