Warning, file /include/boost/msm/front/detail/common_states.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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/map.hpp>
0018 #include <boost/fusion/include/at_key.hpp>
0019 #include <boost/type_traits/add_const.hpp>
0020
0021 namespace boost { namespace msm { namespace front {namespace detail
0022 {
0023 template <class Attributes= ::boost::fusion::map<> >
0024 struct inherit_attributes
0025 {
0026 inherit_attributes():m_attributes(){}
0027 inherit_attributes(Attributes const& the_attributes):m_attributes(the_attributes){}
0028
0029 typedef Attributes attributes_type;
0030 template <class Index>
0031 typename ::boost::fusion::result_of::at_key<attributes_type,
0032 Index>::type
0033 get_attribute(Index const&)
0034 {
0035 return ::boost::fusion::at_key<Index>(m_attributes);
0036 }
0037
0038 template <class Index>
0039 typename ::boost::add_const<
0040 typename ::boost::fusion::result_of::at_key<attributes_type,
0041 Index>::type>::type
0042 get_attribute(Index const&)const
0043 {
0044 return const_cast<
0045 typename ::boost::add_const<
0046 typename ::boost::fusion::result_of::at_key< attributes_type,
0047 Index >::type>::type>
0048 (::boost::fusion::at_key<Index>(m_attributes));
0049 }
0050
0051 private:
0052
0053 Attributes m_attributes;
0054 };
0055
0056
0057 template<class USERBASE,class Attributes= ::boost::fusion::map<> >
0058 struct state_base : public inherit_attributes<Attributes>, USERBASE
0059 {
0060 typedef USERBASE user_state_base;
0061 typedef Attributes attributes_type;
0062
0063
0064
0065 template <class Event,class FSM>
0066 void on_entry(Event const& ,FSM&){}
0067 template <class Event,class FSM>
0068 void on_exit(Event const&,FSM& ){}
0069
0070 typedef ::boost::mpl::vector0<> internal_transition_table;
0071 typedef ::boost::mpl::vector0<> transition_table;
0072 };
0073
0074 }}}}
0075
0076 #endif
0077