// Copyright 2008 Christophe Henry // henry UNDERSCORE christophe AT hotmail DOT com // This is an extended version of the state machine available in the boost::mpl library // Distributed under the same license as the original. // Copyright for the original version: // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed // under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_MSM_ROW2_HELPER_HPP #define BOOST_MSM_ROW2_HELPER_HPP #include #include namespace boost { namespace msm { namespace front { namespace detail { template< typename CalledForAction , typename Event , void (CalledForAction::*action)(Event const&) > struct row2_action_helper { template static void call_helper(FSM&,Evt const& evt,SourceState&,TargetState&, AllStates& all_states,::boost::mpl::false_ const &) { // in this front-end, we don't need to know source and target states ( ::boost::fusion::at_key(all_states).*action)(evt); } template static void call_helper(FSM& fsm,Evt const& evt,SourceState&,TargetState&,AllStates&, ::boost::mpl::true_ const &) { // in this front-end, we don't need to know source and target states (fsm.*action)(evt); } }; template< typename CalledForGuard , typename Event , bool (CalledForGuard::*guard)(Event const&) > struct row2_guard_helper { template static bool call_helper(FSM&,Evt const& evt,SourceState&,TargetState&, AllStates& all_states, ::boost::mpl::false_ const &) { // in this front-end, we don't need to know source and target states return ( ::boost::fusion::at_key(all_states).*guard)(evt); } template static bool call_helper(FSM& fsm,Evt const& evt,SourceState&,TargetState&, AllStates&,::boost::mpl::true_ const &) { // in this front-end, we don't need to know source and target states return (fsm.*guard)(evt); } }; } }}} #endif //BOOST_MSM_ROW2_HELPER_HPP