annotate DEPENDENCIES/generic/include/boost/msm/front/internal_row.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // Copyright 2008 Christophe Henry
Chris@16 2 // henry UNDERSCORE christophe AT hotmail DOT com
Chris@16 3 // This is an extended version of the state machine available in the boost::mpl library
Chris@16 4 // Distributed under the same license as the original.
Chris@16 5 // Copyright for the original version:
Chris@16 6 // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
Chris@16 7 // under the Boost Software License, Version 1.0. (See accompanying
Chris@16 8 // file LICENSE_1_0.txt or copy at
Chris@16 9 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 10
Chris@16 11 #ifndef BOOST_MSM_INTERNAL_ROW_HPP
Chris@16 12 #define BOOST_MSM_INTERNAL_ROW_HPP
Chris@16 13
Chris@16 14 #include <boost/type_traits/is_base_of.hpp>
Chris@16 15 #include <boost/mpl/bool.hpp>
Chris@16 16 #include <boost/fusion/include/at_key.hpp>
Chris@16 17 #include <boost/msm/back/common_types.hpp>
Chris@16 18 #include <boost/msm/row_tags.hpp>
Chris@16 19 #include <boost/msm/front/detail/row2_helper.hpp>
Chris@16 20
Chris@16 21 namespace boost { namespace msm { namespace front
Chris@16 22 {
Chris@16 23 template<
Chris@16 24 class Event
Chris@16 25 , typename CalledForAction
Chris@16 26 , void (CalledForAction::*action)(Event const&)
Chris@16 27 >
Chris@16 28 struct a_internal
Chris@16 29 {
Chris@16 30 typedef sm_a_i_row_tag row_type_tag;
Chris@16 31 typedef Event Evt;
Chris@16 32 template <class FSM,class SourceState,class TargetState,class AllStates>
Chris@16 33 static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
Chris@16 34 AllStates& all_states)
Chris@16 35 {
Chris@16 36 // in this front-end, we don't need to know source and target states
Chris@16 37 ::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
Chris@16 38 (fsm,evt,src,tgt,all_states,
Chris@16 39 ::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
Chris@16 40 return ::boost::msm::back::HANDLED_TRUE;
Chris@16 41 }
Chris@16 42 };
Chris@16 43
Chris@16 44 template<
Chris@16 45 class Event
Chris@16 46 , typename CalledForAction
Chris@16 47 , void (CalledForAction::*action)(Event const&)
Chris@16 48 , typename CalledForGuard
Chris@16 49 , bool (CalledForGuard::*guard)(Event const&)
Chris@16 50 >
Chris@16 51 struct internal
Chris@16 52 {
Chris@16 53 typedef sm_i_row_tag row_type_tag;
Chris@16 54 typedef Event Evt;
Chris@16 55 template <class FSM,class SourceState,class TargetState,class AllStates>
Chris@16 56 static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
Chris@16 57 AllStates& all_states)
Chris@16 58 {
Chris@16 59 // in this front-end, we don't need to know source and target states
Chris@16 60 ::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
Chris@16 61 (fsm,evt,src,tgt,all_states,
Chris@16 62 ::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
Chris@16 63 return ::boost::msm::back::HANDLED_TRUE;
Chris@16 64 }
Chris@16 65 template <class FSM,class SourceState,class TargetState,class AllStates>
Chris@16 66 static bool guard_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
Chris@16 67 AllStates& all_states)
Chris@16 68 {
Chris@16 69 // in this front-end, we don't need to know source and target states
Chris@16 70 return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
Chris@16 71 (fsm,evt,src,tgt,all_states,
Chris@16 72 ::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
Chris@16 73 }
Chris@16 74 };
Chris@16 75 template<
Chris@16 76 class Event
Chris@16 77 , typename CalledForGuard
Chris@16 78 , bool (CalledForGuard::*guard)(Event const&)
Chris@16 79 >
Chris@16 80 struct g_internal
Chris@16 81 {
Chris@16 82 typedef sm_g_i_row_tag row_type_tag;
Chris@16 83 typedef Event Evt;
Chris@16 84 template <class FSM,class SourceState,class TargetState,class AllStates>
Chris@16 85 static bool guard_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
Chris@16 86 AllStates& all_states)
Chris@16 87 {
Chris@16 88 // in this front-end, we don't need to know source and target states
Chris@16 89 return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
Chris@16 90 (fsm,evt,src,tgt,all_states,
Chris@16 91 ::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
Chris@16 92 }
Chris@16 93 };
Chris@16 94 template<
Chris@16 95 class Event
Chris@16 96 >
Chris@16 97 struct _internal
Chris@16 98 {
Chris@16 99 typedef sm__i_row_tag row_type_tag;
Chris@16 100 typedef Event Evt;
Chris@16 101 };
Chris@16 102 }}}
Chris@16 103
Chris@16 104 #endif //BOOST_MSM_INTERNAL_ROW_HPP
Chris@16 105