1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef BOOST_MSM_ROW2_HELPER_HPP
- #define BOOST_MSM_ROW2_HELPER_HPP
- #include <boost/mpl/bool.hpp>
- #include <boost/fusion/include/at_key.hpp>
- namespace boost { namespace msm { namespace front
- {
- namespace detail
- {
- template<
- typename CalledForAction
- , typename Event
- , void (CalledForAction::*action)(Event const&)
- >
- struct row2_action_helper
- {
- template <class FSM,class Evt,class SourceState,class TargetState, class AllStates>
- static void call_helper(FSM&,Evt const& evt,SourceState&,TargetState&,
- AllStates& all_states,::boost::mpl::false_ const &)
- {
-
- ( ::boost::fusion::at_key<CalledForAction>(all_states).*action)(evt);
- }
- template <class FSM,class Evt,class SourceState,class TargetState, class AllStates>
- static void call_helper(FSM& fsm,Evt const& evt,SourceState&,TargetState&,AllStates&,
- ::boost::mpl::true_ const &)
- {
-
- (fsm.*action)(evt);
- }
- };
- template<
- typename CalledForGuard
- , typename Event
- , bool (CalledForGuard::*guard)(Event const&)
- >
- struct row2_guard_helper
- {
- template <class FSM,class Evt,class SourceState,class TargetState,class AllStates>
- static bool call_helper(FSM&,Evt const& evt,SourceState&,TargetState&,
- AllStates& all_states, ::boost::mpl::false_ const &)
- {
-
- return ( ::boost::fusion::at_key<CalledForGuard>(all_states).*guard)(evt);
- }
- template <class FSM,class Evt,class SourceState,class TargetState,class AllStates>
- static bool call_helper(FSM& fsm,Evt const& evt,SourceState&,TargetState&,
- AllStates&,::boost::mpl::true_ const &)
- {
-
- return (fsm.*guard)(evt);
- }
- };
- }
- }}}
- #endif
|