File indexing completed on 2025-07-11 08:17:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_MSM_FRONT_DETAILS_COMMON_STATES_H
0012 #define BOOST_MSM_FRONT_DETAILS_COMMON_STATES_H
0013
0014 #include <boost/mpl/int.hpp>
0015
0016 #include <boost/mpl/vector.hpp>
0017 #include <boost/fusion/container/vector.hpp>
0018 #include <boost/fusion/container/map.hpp>
0019 #include <boost/fusion/include/at_key.hpp>
0020 #include <boost/type_traits/add_const.hpp>
0021
0022 namespace boost { namespace msm { namespace front {namespace detail
0023 {
0024 template <class Attributes= ::boost::fusion::map<> >
0025 struct inherit_attributes
0026 {
0027 inherit_attributes():m_attributes(){}
0028 inherit_attributes(Attributes const& the_attributes):m_attributes(the_attributes){}
0029
0030 typedef Attributes attributes_type;
0031 template <class Index>
0032 typename ::boost::fusion::result_of::at_key<attributes_type,
0033 Index>::type
0034 get_attribute(Index const&)
0035 {
0036 return ::boost::fusion::at_key<Index>(m_attributes);
0037 }
0038
0039 template <class Index>
0040 typename ::boost::add_const<
0041 typename ::boost::fusion::result_of::at_key<attributes_type,
0042 Index>::type>::type
0043 get_attribute(Index const&)const
0044 {
0045 return const_cast<
0046 typename ::boost::add_const<
0047 typename ::boost::fusion::result_of::at_key< attributes_type,
0048 Index >::type>::type>
0049 (::boost::fusion::at_key<Index>(m_attributes));
0050 }
0051
0052 private:
0053
0054 Attributes m_attributes;
0055 };
0056
0057
0058 template<class USERBASE,class Attributes= ::boost::fusion::map<> >
0059 struct state_base : public inherit_attributes<Attributes>, USERBASE
0060 {
0061 typedef USERBASE user_state_base;
0062 typedef Attributes attributes_type;
0063
0064
0065
0066 template <class Event,class FSM>
0067 void on_entry(Event const& ,FSM&){}
0068 template <class Event,class FSM>
0069 void on_exit(Event const&,FSM& ){}
0070
0071 typedef ::boost::mpl::vector<> internal_transition_table;
0072 typedef ::boost::fusion::vector<> internal_transition_table11;
0073 typedef ::boost::fusion::vector<> transition_table;
0074 };
0075
0076 }}}}
0077
0078 #endif
0079