2
0
mirror of https://github.com/boostorg/msm.git synced 2026-02-18 14:12:31 +00:00

corrected inspection report warnings

[SVN r62522]
This commit is contained in:
Christophe Henry
2010-06-07 20:51:03 +00:00
parent eaeea5258c
commit ff11bb5eff
23 changed files with 2319 additions and 2319 deletions

View File

@@ -18,22 +18,22 @@ namespace boost { namespace msm { namespace back
// helper to replace std::plus as the lack of implicit conversion makes it not usable in one of our bind
template<class _Ty,class _Tz>
struct plus2
: public std::binary_function<_Ty, _Tz, _Ty>
: public std::binary_function<_Ty, _Tz, _Ty>
{ // functor for operator+
_Ty operator()( _Ty _Left, _Tz _Right) const
{ // apply operator+ to operands
return (_Left + _Right);
}
_Ty operator()( _Ty _Left, _Tz _Right) const
{ // apply operator+ to operands
return (_Left + _Right);
}
};
// helper to dereference a pointer to a function pointer
template <class T>
struct deref
{
typedef T& result_type;
T& operator()(T* f) const
{
return *f;
}
typedef T& result_type;
T& operator()(T* f) const
{
return *f;
}
};
} } }//boost::msm::back
#endif //BOOST_MSM_BACK_BIND_HELPERS_H

View File

@@ -19,7 +19,7 @@ namespace boost { namespace msm { namespace back
struct NoCopy : ::boost::noncopyable
{
};
// allows deep copy
struct DeepCopy
{

View File

@@ -17,7 +17,7 @@ namespace boost { namespace msm { namespace back
{
struct favor_runtime_speed
{
typedef ::boost::mpl::true_ add_forwarding_rows;
typedef ::boost::mpl::true_ add_forwarding_rows;
};
}}}// boost::msm::back

View File

@@ -153,18 +153,18 @@ struct dispatch_table
template <class EventType,class Enable=void>
struct default_init_cell
{
default_init_cell(dispatch_table* self_,cell* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
default_init_cell(dispatch_table* self_,cell* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
template <class State>
typename ::boost::enable_if<typename has_state_delayed_event<State,Event>::type,void>::type
operator()(boost::msm::wrap<State> const&,boost::msm::back::dummy<0> = 0)
{
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::defer_transition;
tofill_entries[state_id] = call_no_transition;
}
}
template <class State>
typename ::boost::disable_if<typename has_state_delayed_event<State,Event>::type,void >::type
operator()(boost::msm::wrap<State> const&,boost::msm::back::dummy<1> = 0)
@@ -175,8 +175,8 @@ struct dispatch_table
tofill_entries[state_id] = call_no_transition;
}
dispatch_table* self;
cell* tofill_entries;
dispatch_table* self;
cell* tofill_entries;
};
// variant for anonymous transitions
@@ -185,23 +185,23 @@ struct dispatch_table
typename ::boost::enable_if<
typename is_completion_event<EventType>::type>::type>
{
default_init_cell(dispatch_table* self_,cell* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
default_init_cell(dispatch_table* self_,cell* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
// this event is a compound one (not a real one, just one for use in event-less transitions)
// Note this event cannot be used as deferred!
template <class State>
template <class State>
void operator()(boost::msm::wrap<State> const&)
{
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::default_eventless_transition;
tofill_entries[state_id] = call_no_transition;
}
}
dispatch_table* self;
cell* tofill_entries;
dispatch_table* self;
cell* tofill_entries;
};
public:
@@ -209,7 +209,7 @@ struct dispatch_table
dispatch_table()
{
// Initialize cells for no transition
::boost::mpl::for_each<typename generate_state_set<Stt>::type,
::boost::mpl::for_each<typename generate_state_set<Stt>::type,
boost::msm::wrap< ::boost::mpl::placeholders::_1> >
(default_init_cell<Event>(this,entries));

View File

@@ -29,41 +29,41 @@ namespace boost { namespace msm { namespace back
template <class Fsm>
struct process_any_event_helper
{
process_any_event_helper(msm::back::HandledEnum& res_,Fsm* self_,::boost::any any_event_):
res(res_),self(self_),any_event(any_event_),finished(false){}
template <class Event>
void operator()(boost::msm::wrap<Event> const&)
{
if ( ! finished && ::boost::any_cast<Event>(&any_event)!=0)
{
finished = true;
res = self->process_event(::boost::any_cast<Event>(any_event));
}
}
process_any_event_helper(msm::back::HandledEnum& res_,Fsm* self_,::boost::any any_event_):
res(res_),self(self_),any_event(any_event_),finished(false){}
template <class Event>
void operator()(boost::msm::wrap<Event> const&)
{
if ( ! finished && ::boost::any_cast<Event>(&any_event)!=0)
{
finished = true;
res = self->process_event(::boost::any_cast<Event>(any_event));
}
}
private:
msm::back::HandledEnum& res;
Fsm* self;
::boost::any any_event;
bool finished;
msm::back::HandledEnum& res;
Fsm* self;
::boost::any any_event;
bool finished;
};
#define BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(fsmname) \
namespace boost { namespace msm { namespace back{ \
template<> \
::boost::msm::back::HandledEnum fsmname::process_any_event( ::boost::any const& any_event) \
{ \
typedef ::boost::msm::back::recursive_get_transition_table<fsmname>::type stt; \
typedef ::boost::msm::back::generate_event_set<stt>::type all_events; \
::boost::msm::back::HandledEnum res= ::boost::msm::back::HANDLED_FALSE; \
::boost::mpl::for_each<all_events, ::boost::msm::wrap< ::boost::mpl::placeholders::_1> > \
(::boost::msm::back::process_any_event_helper<fsmname>(res,this,any_event)); \
return res; \
} \
::boost::msm::back::HandledEnum fsmname::process_any_event( ::boost::any const& any_event) \
{ \
typedef ::boost::msm::back::recursive_get_transition_table<fsmname>::type stt; \
typedef ::boost::msm::back::generate_event_set<stt>::type all_events; \
::boost::msm::back::HandledEnum res= ::boost::msm::back::HANDLED_FALSE; \
::boost::mpl::for_each<all_events, ::boost::msm::wrap< ::boost::mpl::placeholders::_1> > \
(::boost::msm::back::process_any_event_helper<fsmname>(res,this,any_event)); \
return res; \
} \
}}}
struct favor_compile_time
{
typedef ::boost::mpl::false_ add_forwarding_rows;
typedef ::boost::mpl::false_ add_forwarding_rows;
};
// Generates a singleton runtime lookup table that maps current state
@@ -82,23 +82,23 @@ struct dispatch_table < Fsm, Stt, Event, ::boost::msm::back::favor_compile_time>
typedef typename generate_state_set<Stt>::type state_list;
BOOST_STATIC_CONSTANT(int, max_state = ( ::boost::mpl::size<state_list>::value));
struct chain_row
{
HandledEnum operator()(Fsm& fsm, int region,int state,Event const& evt) const
{
HandledEnum res = HANDLED_FALSE;
typename std::deque<cell>::const_iterator it = one_state.begin();
while (it != one_state.end() && res != HANDLED_TRUE)
{
HandledEnum handled = (*it)(fsm,region,state,evt);
res = ((HANDLED_GUARD_REJECT==handled) || (HANDLED_GUARD_REJECT==res))?
HANDLED_GUARD_REJECT:handled;
++it;
}
return res;
}
std::deque<cell> one_state;
};
struct chain_row
{
HandledEnum operator()(Fsm& fsm, int region,int state,Event const& evt) const
{
HandledEnum res = HANDLED_FALSE;
typename std::deque<cell>::const_iterator it = one_state.begin();
while (it != one_state.end() && res != HANDLED_TRUE)
{
HandledEnum handled = (*it)(fsm,region,state,evt);
res = ((HANDLED_GUARD_REJECT==handled) || (HANDLED_GUARD_REJECT==res))?
HANDLED_GUARD_REJECT:handled;
++it;
}
return res;
}
std::deque<cell> one_state;
};
template <class TransitionState>
static HandledEnum call_submachine(Fsm& fsm, int region, int state, Event const& evt)
{
@@ -155,64 +155,64 @@ struct dispatch_table < Fsm, Stt, Event, ::boost::msm::back::favor_compile_time>
template <class EventType,class Enable=void>
struct default_init_cell
{
default_init_cell(dispatch_table* self_,chain_row* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
template <bool deferred,bool composite, int some_dummy=0>
struct helper
{};
template <int some_dummy> struct helper<true,false,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::defer_transition;
tofill[state_id].one_state.push_back(call_no_transition);
}
};
template <int some_dummy> struct helper<true,true,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::defer_transition;
tofill[state_id].one_state.push_back(call_no_transition);
}
};
template <int some_dummy> struct helper<false,true,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &call_submachine< State >;
tofill[state_id].one_state.push_front(call_no_transition);
}
};
template <int some_dummy> struct helper<false,false,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::call_no_transition;
tofill[state_id].one_state.push_back(call_no_transition);
}
};
template <class State>
void operator()(boost::msm::wrap<State> const& s)
{
helper<has_state_delayed_event<State,Event>::type::value,
is_composite_state<State>::type::value>::execute(s,tofill_entries);
}
dispatch_table* self;
chain_row* tofill_entries;
default_init_cell(dispatch_table* self_,chain_row* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
template <bool deferred,bool composite, int some_dummy=0>
struct helper
{};
template <int some_dummy> struct helper<true,false,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::defer_transition;
tofill[state_id].one_state.push_back(call_no_transition);
}
};
template <int some_dummy> struct helper<true,true,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::defer_transition;
tofill[state_id].one_state.push_back(call_no_transition);
}
};
template <int some_dummy> struct helper<false,true,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &call_submachine< State >;
tofill[state_id].one_state.push_front(call_no_transition);
}
};
template <int some_dummy> struct helper<false,false,some_dummy>
{
template <class State>
static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::call_no_transition;
tofill[state_id].one_state.push_back(call_no_transition);
}
};
template <class State>
void operator()(boost::msm::wrap<State> const& s)
{
helper<has_state_delayed_event<State,Event>::type::value,
is_composite_state<State>::type::value>::execute(s,tofill_entries);
}
dispatch_table* self;
chain_row* tofill_entries;
};
// variant for anonymous transitions
@@ -221,23 +221,23 @@ struct dispatch_table < Fsm, Stt, Event, ::boost::msm::back::favor_compile_time>
typename ::boost::enable_if<
typename is_completion_event<EventType>::type>::type>
{
default_init_cell(dispatch_table* self_,chain_row* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
default_init_cell(dispatch_table* self_,chain_row* tofill_entries_)
: self(self_),tofill_entries(tofill_entries_)
{}
// this event is a compound one (not a real one, just one for use in event-less transitions)
// Note this event cannot be used as deferred!
template <class State>
template <class State>
void operator()(boost::msm::wrap<State> const&)
{
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
cell call_no_transition = &Fsm::default_eventless_transition;
tofill_entries[state_id].one_state.push_back(call_no_transition);
}
}
dispatch_table* self;
chain_row* tofill_entries;
dispatch_table* self;
chain_row* tofill_entries;
};
public:
@@ -245,13 +245,13 @@ struct dispatch_table < Fsm, Stt, Event, ::boost::msm::back::favor_compile_time>
dispatch_table()
{
// Initialize cells for no transition
::boost::mpl::for_each<
::boost::mpl::filter_view<
Stt, ::boost::is_base_of<transition_event< ::boost::mpl::placeholders::_>, Event> > >
(init_cell(this));
::boost::mpl::for_each<
::boost::mpl::filter_view<
Stt, ::boost::is_base_of<transition_event< ::boost::mpl::placeholders::_>, Event> > >
(init_cell(this));
::boost::mpl::for_each<
typename generate_state_set<Stt>::type,
::boost::mpl::for_each<
typename generate_state_set<Stt>::type,
boost::msm::wrap< ::boost::mpl::placeholders::_1> >
(default_init_cell<Event>(this,entries));
@@ -261,7 +261,7 @@ struct dispatch_table < Fsm, Stt, Event, ::boost::msm::back::favor_compile_time>
static const dispatch_table instance;
public: // data members
chain_row entries[max_state];
chain_row entries[max_state];
};
template <class Fsm,class Stt, class Event>

View File

@@ -28,18 +28,18 @@ public:
void set_initial_states(int* const initial_states)
{
for (int i=0;i<NumberOfRegions;++i)
m_initialStates[i] = initial_states[i];
m_initialStates[i] = initial_states[i];
}
void history_exit(int* const )
{
// ignore
// ignore
}
// returns the state where the state machine should be at start
template <class Event>
template <class Event>
int* const history_entry(Event const& )
{
// always come back to the original state
return m_initialStates;
// always come back to the original state
return m_initialStates;
}
NoHistoryImpl<NumberOfRegions>& operator=(NoHistoryImpl<NumberOfRegions> const& rhs)
{
@@ -63,19 +63,19 @@ public:
void set_initial_states(int* const initial_states)
{
for (int i=0;i<NumberOfRegions;++i)
m_initialStates[i] = initial_states[i];
m_initialStates[i] = initial_states[i];
}
void history_exit(int* const current_states)
{
for (int i=0;i<NumberOfRegions;++i)
m_initialStates[i] = current_states[i];
m_initialStates[i] = current_states[i];
}
// returns the state where the state machine should be at start
template <class Event>
template <class Event>
int* const history_entry(Event const& )
{
// always load back the last active state
return m_initialStates;
// always load back the last active state
return m_initialStates;
}
AlwaysHistoryImpl<NumberOfRegions>& operator=(AlwaysHistoryImpl<NumberOfRegions> const& rhs)
{
@@ -100,25 +100,25 @@ public:
{
for (int i=0;i<NumberOfRegions;++i)
{
m_currentStates[i] = initial_states[i];
m_currentStates[i] = initial_states[i];
m_initialStates[i] = initial_states[i];
}
}
void history_exit(int* const current_states)
{
for (int i=0;i<NumberOfRegions;++i)
m_currentStates[i] = current_states[i];
m_currentStates[i] = current_states[i];
}
// returns the state where the state machine should be at start
template <class Event>
int* const history_entry(Event const&)
int* const history_entry(Event const&)
{
if ( ::boost::mpl::contains<Events,Event>::value)
{
return m_currentStates;
}
// not one of our events, no history
return m_initialStates;
{
return m_currentStates;
}
// not one of our events, no history
return m_initialStates;
}
ShallowHistoryImpl<Events,NumberOfRegions>& operator=(ShallowHistoryImpl<Events,NumberOfRegions> const& rhs)
{

View File

@@ -92,49 +92,49 @@ template <class stt>
struct generate_state_ids
{
typedef typename
::boost::mpl::fold<
stt,::boost::mpl::pair< ::boost::mpl::map< >, ::boost::mpl::int_<0> >,
::boost::mpl::pair<
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::fold<
stt,::boost::mpl::pair< ::boost::mpl::map< >, ::boost::mpl::int_<0> >,
::boost::mpl::pair<
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
transition_source_type< ::boost::mpl::placeholders::_2> >,
::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::insert< ::boost::mpl::first<mpl::placeholders::_1>,
make_pair_source_state_id< ::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::placeholders::_2> >
>,
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::insert< ::boost::mpl::first<mpl::placeholders::_1>,
make_pair_source_state_id< ::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::placeholders::_2> >
>,
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
transition_source_type< ::boost::mpl::placeholders::_2> >,
::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::next< ::boost::mpl::second<mpl::placeholders::_1 > >
>
> //pair
>::type source_state_ids;
::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::next< ::boost::mpl::second<mpl::placeholders::_1 > >
>
> //pair
>::type source_state_ids;
typedef typename ::boost::mpl::first<source_state_ids>::type source_state_map;
typedef typename ::boost::mpl::second<source_state_ids>::type highest_state_id;
typedef typename
::boost::mpl::fold<
stt,::boost::mpl::pair<source_state_map,highest_state_id >,
::boost::mpl::pair<
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::fold<
stt,::boost::mpl::pair<source_state_map,highest_state_id >,
::boost::mpl::pair<
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
transition_target_type< ::boost::mpl::placeholders::_2> >,
::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::insert< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
make_pair_target_state_id< ::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::placeholders::_2> >
>,
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::first< ::boost::mpl::placeholders::_1>,
::boost::mpl::insert< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
make_pair_target_state_id< ::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::placeholders::_2> >
>,
::boost::mpl::if_<
::boost::mpl::has_key< ::boost::mpl::first< ::boost::mpl::placeholders::_1>,
transition_target_type< ::boost::mpl::placeholders::_2> >,
::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::next< ::boost::mpl::second< ::boost::mpl::placeholders::_1 > >
>
> //pair
>::type all_state_ids;
::boost::mpl::second< ::boost::mpl::placeholders::_1 >,
::boost::mpl::next< ::boost::mpl::second< ::boost::mpl::placeholders::_1 > >
>
> //pair
>::type all_state_ids;
typedef typename ::boost::mpl::first<all_state_ids>::type type;
};
@@ -151,9 +151,9 @@ template <class States>
struct get_initial_states
{
typedef typename ::boost::mpl::if_<
::boost::mpl::is_sequence<States>,
States,
typename ::boost::mpl::push_back< ::boost::mpl::vector0<>,States>::type >::type type;
::boost::mpl::is_sequence<States>,
States,
typename ::boost::mpl::push_back< ::boost::mpl::vector0<>,States>::type >::type type;
};
// returns a mpl::int_ containing the size of a region. If the argument is not a sequence, returns 1
@@ -161,9 +161,9 @@ template <class region>
struct get_number_of_regions
{
typedef typename mpl::if_<
::boost::mpl::is_sequence<region>,
::boost::mpl::size<region>,
::boost::mpl::int_<1> >::type type;
::boost::mpl::is_sequence<region>,
::boost::mpl::size<region>,
::boost::mpl::int_<1> >::type type;
};
// builds a mpl::vector of initial states
@@ -171,9 +171,9 @@ template <class region>
struct get_regions_as_sequence
{
typedef typename ::boost::mpl::if_<
::boost::mpl::is_sequence<region>,
region,
typename ::boost::mpl::push_back< ::boost::mpl::vector0<>,region>::type >::type type;
::boost::mpl::is_sequence<region>,
region,
typename ::boost::mpl::push_back< ::boost::mpl::vector0<>,region>::type >::type type;
};
template <class ToCreateSeq>
@@ -216,8 +216,8 @@ struct keep_source_names
{
// instead of the rows we want only the names of the states (from source)
typedef typename
::boost::mpl::transform<
stt,transition_source_type< ::boost::mpl::placeholders::_1> >::type type;
::boost::mpl::transform<
stt,transition_source_type< ::boost::mpl::placeholders::_1> >::type type;
};
// transform a transition table in a container of target states
@@ -226,8 +226,8 @@ struct keep_target_names
{
// instead of the rows we want only the names of the states (from source)
typedef typename
::boost::mpl::transform<
stt,transition_target_type< ::boost::mpl::placeholders::_1> >::type type;
::boost::mpl::transform<
stt,transition_target_type< ::boost::mpl::placeholders::_1> >::type type;
};
template <class stt>
@@ -237,15 +237,15 @@ struct generate_state_set
typedef typename keep_source_names<stt>::type sources;
typedef typename keep_target_names<stt>::type targets;
typedef typename
::boost::mpl::fold<
sources, ::boost::mpl::set<>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2>
>::type source_set;
::boost::mpl::fold<
sources, ::boost::mpl::set<>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2>
>::type source_set;
typedef typename
::boost::mpl::fold<
targets,source_set,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2>
>::type type;
::boost::mpl::fold<
targets,source_set,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2>
>::type type;
};
// iterates through the transition table and generate a mpl::set<> containing all the events
@@ -271,8 +271,8 @@ struct has_state_delayed_event
typedef typename ::boost::mpl::find<typename State::deferred_events,Event>::type found;
typedef typename ::boost::mpl::if_<
::boost::is_same<found,typename ::boost::mpl::end<typename State::deferred_events>::type >,
::boost::mpl::bool_<false>,
::boost::mpl::bool_<true> >::type type;
::boost::mpl::bool_<false>,
::boost::mpl::bool_<true> >::type type;
};
// returns a mpl::bool_<true> if State has any deferred event
template <class State>
@@ -351,15 +351,15 @@ struct create_stt
typedef typename get_regions_as_sequence<typename Derived::initial_state>::type init_states;
// iterate through the initial states and add them in the stt if not already there
typedef typename
::boost::mpl::fold<
init_states,Stt,
::boost::mpl::if_<
::boost::mpl::has_key<states, ::boost::mpl::placeholders::_2>,
::boost::mpl::placeholders::_1,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::end<mpl::placeholders::_1>,
not_a_row< ::boost::mpl::placeholders::_2 > >
>
>::type with_init;
::boost::mpl::fold<
init_states,Stt,
::boost::mpl::if_<
::boost::mpl::has_key<states, ::boost::mpl::placeholders::_2>,
::boost::mpl::placeholders::_1,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::end<mpl::placeholders::_1>,
not_a_row< ::boost::mpl::placeholders::_2 > >
>
>::type with_init;
// do the same for states marked as explicitly created
typedef typename get_explicit_creation_as_sequence<
typename ::boost::mpl::eval_if<
@@ -369,19 +369,19 @@ struct create_stt
>::type fake_explicit_created;
typedef typename
::boost::mpl::transform<
fake_explicit_created,convert_fake_state< ::boost::mpl::placeholders::_1,Derived> >::type explicit_created;
::boost::mpl::transform<
fake_explicit_created,convert_fake_state< ::boost::mpl::placeholders::_1,Derived> >::type explicit_created;
typedef typename
::boost::mpl::fold<
explicit_created,with_init,
::boost::mpl::if_<
::boost::mpl::has_key<states, ::boost::mpl::placeholders::_2>,
::boost::mpl::placeholders::_1,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::end<mpl::placeholders::_1>,
not_a_row< ::boost::mpl::placeholders::_2 > >
>
>::type type;
::boost::mpl::fold<
explicit_created,with_init,
::boost::mpl::if_<
::boost::mpl::has_key<states, ::boost::mpl::placeholders::_2>,
::boost::mpl::placeholders::_1,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::end<mpl::placeholders::_1>,
not_a_row< ::boost::mpl::placeholders::_2 > >
>
>::type type;
};
// returns the transition table of a Composite state
@@ -397,16 +397,16 @@ struct recursive_get_transition_table
{
// get the transition table of the state if it's a state machine
typedef typename ::boost::mpl::eval_if<typename is_composite_state<Composite>::type,
get_transition_table<Composite>,
::boost::mpl::vector0<> >::type org_table;
get_transition_table<Composite>,
::boost::mpl::vector0<> >::type org_table;
typedef typename generate_state_set<org_table>::type states;
// and for every substate, recursively get the transition table if it's a state machine
typedef typename ::boost::mpl::fold<
states,org_table,
::boost::mpl::insert_range< ::boost::mpl::placeholders::_1, ::boost::mpl::end<mpl::placeholders::_1>,
recursive_get_transition_table< ::boost::mpl::placeholders::_2 > >
states,org_table,
::boost::mpl::insert_range< ::boost::mpl::placeholders::_1, ::boost::mpl::end<mpl::placeholders::_1>,
recursive_get_transition_table< ::boost::mpl::placeholders::_2 > >
>::type type;
};
@@ -460,10 +460,10 @@ struct find_completion_events
typedef typename ::boost::mpl::fold<
event_list, ::boost::mpl::set<>,
::boost::mpl::if_<
is_completion_event< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
::boost::mpl::placeholders::_1 >
::boost::mpl::if_<
is_completion_event< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
::boost::mpl::placeholders::_1 >
>::type type;
};
@@ -548,10 +548,10 @@ struct is_state_blocking
{
typedef typename ::boost::mpl::fold<
typename StateType::flag_list, ::boost::mpl::set<>,
::boost::mpl::if_<
has_event_blocking_flag< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
::boost::mpl::placeholders::_1 >
::boost::mpl::if_<
has_event_blocking_flag< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
::boost::mpl::placeholders::_1 >
>::type blocking_flags;
typedef typename ::boost::mpl::if_<
@@ -568,10 +568,10 @@ struct has_fsm_blocking_states
typedef typename ::boost::mpl::fold<
state_list, ::boost::mpl::set<>,
::boost::mpl::if_<
is_state_blocking< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
::boost::mpl::placeholders::_1 >
::boost::mpl::if_<
is_state_blocking< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
::boost::mpl::placeholders::_1 >
>::type blocking_states;
typedef typename ::boost::mpl::if_<

View File

@@ -176,7 +176,7 @@ private:
public:
// tags
//typedef ::boost::mpl::true_ composite_state;
//typedef ::boost::mpl::true_ composite_state;
typedef int composite_tag;
// in case someone needs to know
@@ -229,7 +229,7 @@ private:
}
exit_pt():m_forward(){}
// by assignments, we keep our forwarding functor unchanged as our containing SM did not change
template <class RHS>
template <class RHS>
exit_pt(RHS& rhs):m_forward(){}
exit_pt<ExitPoint>& operator= (const exit_pt<ExitPoint>& )
{
@@ -805,37 +805,37 @@ private:
{
typedef g_row_<Transition> type;
};
template <class Transition,class StateType>
template <class Transition,class StateType>
struct create_backend_stt<a_row_tag,Transition,StateType>
{
typedef a_row_<Transition> type;
};
template <class Transition,class StateType>
template <class Transition,class StateType>
struct create_backend_stt<_row_tag,Transition,StateType>
{
typedef _row_<Transition> type;
};
template <class Transition,class StateType>
struct create_backend_stt<row_tag,Transition,StateType>
{
typedef row_<Transition> type;
};
template <class Transition,class StateType>
struct create_backend_stt<row_tag,Transition,StateType>
{
typedef row_<Transition> type;
};
// internal transitions
template <class Transition,class StateType>
struct create_backend_stt<g_irow_tag,Transition,StateType>
{
typedef g_irow_<Transition> type;
};
template <class Transition,class StateType>
template <class Transition,class StateType>
struct create_backend_stt<a_irow_tag,Transition,StateType>
{
typedef a_irow_<Transition> type;
};
template <class Transition,class StateType>
struct create_backend_stt<irow_tag,Transition,StateType>
{
typedef irow_<Transition> type;
};
template <class Transition,class StateType>
struct create_backend_stt<irow_tag,Transition,StateType>
{
typedef irow_<Transition> type;
};
template <class Transition,class StateType>
struct create_backend_stt<_irow_tag,Transition,StateType>
{
@@ -872,22 +872,22 @@ private:
struct create_real_stt
{
//typedef typename BaseType::transition_table stt_simulated;
typedef typename ::boost::mpl::fold<
stt_simulated,mpl::vector0<>,
typedef typename ::boost::mpl::fold<
stt_simulated,mpl::vector0<>,
::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
make_row_tag< ::boost::mpl::placeholders::_2 , BaseType > >
>::type type;
>::type type;
};
template <class Table,class Intermediate,class StateType>
struct add_forwarding_row_helper
{
typedef typename generate_event_set<Table>::type all_events;
typedef typename ::boost::mpl::fold<
all_events, Intermediate,
::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
frow<StateType, ::boost::mpl::placeholders::_2> > >::type type;
};
template <class Table,class Intermediate,class StateType>
struct add_forwarding_row_helper
{
typedef typename generate_event_set<Table>::type all_events;
typedef typename ::boost::mpl::fold<
all_events, Intermediate,
::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
frow<StateType, ::boost::mpl::placeholders::_2> > >::type type;
};
// gets the transition table from a composite and make from it a forwarding row
template <class StateType,class IsComposite>
struct get_internal_transition_table
@@ -899,18 +899,18 @@ private:
// Note: these are added first because they must have a lesser prio
// than the deeper transitions in the sub regions
typedef typename StateType::internal_transition_table istt_simulated;
typedef typename ::boost::mpl::fold<
istt_simulated,::boost::mpl::vector0<>,
typedef typename ::boost::mpl::fold<
istt_simulated,::boost::mpl::vector0<>,
::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
make_row_tag< ::boost::mpl::placeholders::_2 , StateType> >
>::type intermediate;
>::type intermediate;
// and add for every event a forwarding row
typedef typename ::boost::mpl::eval_if<
typename CompilePolicy::add_forwarding_rows,
add_forwarding_row_helper<original_table,intermediate,StateType>,
::boost::mpl::identity<intermediate>
>::type type;
typedef typename ::boost::mpl::eval_if<
typename CompilePolicy::add_forwarding_rows,
add_forwarding_row_helper<original_table,intermediate,StateType>,
::boost::mpl::identity<intermediate>
>::type type;
};
template <class StateType>
struct get_internal_transition_table<StateType, ::boost::mpl::false_ >
@@ -934,14 +934,14 @@ private:
typedef typename Composite::stt Stt;
// for every state, add its transition table (if any)
// transformed as frow
typedef typename ::boost::mpl::fold<state_list,Stt,
::boost::mpl::insert_range<
typedef typename ::boost::mpl::fold<state_list,Stt,
::boost::mpl::insert_range<
::boost::mpl::placeholders::_1,
::boost::mpl::end< ::boost::mpl::placeholders::_1>,
get_internal_transition_table<
get_internal_transition_table<
::boost::mpl::placeholders::_2,
is_composite_state< ::boost::mpl::placeholders::_2> > >
>::type type;
>::type type;
};
// extend the table with tables from composite states
typedef typename extend_table<library_sm>::type complete_table;
@@ -1142,10 +1142,10 @@ private:
public:
// Construct with the default initial states
state_machine<Derived,HistoryPolicy,CompilePolicy >()
:Derived()
,m_events_queue()
,m_deferred_events_queue()
,m_history()
:Derived()
,m_events_queue()
,m_deferred_events_queue()
,m_history()
,m_event_processing(false)
,m_is_included(false)
,m_visitors()
@@ -1166,9 +1166,9 @@ private:
state_machine<Derived,HistoryPolicy,CompilePolicy \
>(BOOST_PP_ENUM(n, MSM_CONSTRUCTOR_HELPER_EXECUTE_SUB, ~ ) ) \
:Derived(BOOST_PP_ENUM_PARAMS(n,t)) \
,m_events_queue() \
,m_deferred_events_queue() \
,m_history() \
,m_events_queue() \
,m_deferred_events_queue() \
,m_history() \
,m_event_processing(false) \
,m_is_included(false) \
,m_visitors() \
@@ -1482,21 +1482,21 @@ private:
#undef MSM_COMPOSITE_ACCEPT_EXECUTE
#undef MSM_COMPOSITE_ACCEPT_SUB
// helper used to call the init states at the start of the state machine
// helper used to call the init states at the start of the state machine
template <class Event>
struct call_init
{
call_init(Event const& an_event,library_sm* self_):
struct call_init
{
call_init(Event const& an_event,library_sm* self_):
evt(an_event),self(self_){}
template <class State>
void operator()(boost::msm::wrap<State> const&)
{
template <class State>
void operator()(boost::msm::wrap<State> const&)
{
execute_entry(::boost::fusion::at_key<State>(self->m_substate_list),evt,*self);
}
private:
}
private:
Event const& evt;
library_sm* self;
};
};
// helper for flag handling. Uses OR by default on orthogonal zones.
template <class Flag,bool orthogonalStates>
struct FlagHelper
@@ -1604,7 +1604,7 @@ private:
{
static void set_sm(library_sm* )
{
// state doesn't need its sm
// state doesn't need its sm
}
};
// create a state requiring a pointer to the state machine
@@ -1613,8 +1613,8 @@ private:
{
static void set_sm(library_sm* sm)
{
// create and set the fsm
::boost::fusion::at_key<State>(sm->m_substate_list).set_sm_ptr(sm);
// create and set the fsm
::boost::fusion::at_key<State>(sm->m_substate_list).set_sm_ptr(sm);
}
};
// main unspecialized helper class
@@ -1657,13 +1657,13 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
m_is_included=true;
::boost::fusion::for_each(m_substate_list,add_state<ContainingSM>(this,sm));
}
// A function object for use with mpl::for_each that stuffs
// A function object for use with mpl::for_each that stuffs
// states into the state list.
template<class ContainingSM>
struct add_state
{
add_state(library_sm* self_,ContainingSM* sm)
: self(self_),containing_sm(sm){}
: self(self_),containing_sm(sm){}
// State is a sub fsm with exit pseudo states and gets a pointer to this fsm, so it can build a callback
template <class StateType>
@@ -1674,7 +1674,7 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
::boost::fusion::at_key<StateType>(self->m_substate_list).set_containing_sm(containing_sm);
}
// State is a sub fsm without exit pseudo states and does not get a callback to this fsm
// or state is a normal state and needs nothing except creation
// or state is a normal state and needs nothing except creation
template <class StateType>
typename ::boost::enable_if<
typename boost::mpl::and_<typename boost::mpl::not_
@@ -1856,7 +1856,7 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
static void do_start(library_sm*,Event const& ){}
};
// start for states machines which are themselves embedded in other state machines (composites)
template <class Event>
template <class Event>
void start(Event const& incomingEvent)
{
region_start_helper< ::boost::mpl::int_<0> >::template do_start(this,incomingEvent);
@@ -1988,7 +1988,7 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
static void do_exit(library_sm*,Event const& ){}
};
// entry/exit for states machines which are themselves embedded in other state machines (composites)
template <class Event,class FsmType>
template <class Event,class FsmType>
void do_entry(Event const& incomingEvent,FsmType& fsm)
{
// by default we activate the history/init states, can be overwritten by direct_event_start_helper
@@ -2001,7 +2001,7 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
m_event_processing = false;
process_message_queue(this);
}
template <class Event,class FsmType>
template <class Event,class FsmType>
void do_exit(Event const& incomingEvent,FsmType& fsm)
{
// first recursively exit the sub machines

View File

@@ -25,8 +25,8 @@ struct inherit_attributes
{
inherit_attributes():m_attributes(){}
inherit_attributes(Attributes const& the_attributes):m_attributes(the_attributes){}
// on the fly attribute creation capability
typedef Attributes attributes_type;
// on the fly attribute creation capability
typedef Attributes attributes_type;
template <class Index>
typename ::boost::fusion::result_of::at_key<attributes_type,
Index>::type
@@ -39,7 +39,7 @@ struct inherit_attributes
typename ::boost::add_const<
typename ::boost::fusion::result_of::at_key<attributes_type,
Index>::type>::type
get_attribute(Index const&)const
get_attribute(Index const&)const
{
return const_cast<
typename ::boost::add_const<
@@ -49,8 +49,8 @@ struct inherit_attributes
}
private:
// attributes
Attributes m_attributes;
// attributes
Attributes m_attributes;
};
// the interface for all states. Defines entry and exit functions. Overwrite to implement for any state needing it.
@@ -58,7 +58,7 @@ template<class USERBASE,class Attributes= ::boost::fusion::map<> >
struct state_base : public inherit_attributes<Attributes>, USERBASE
{
typedef USERBASE user_state_base;
typedef Attributes attributes_type;
typedef Attributes attributes_type;
// empty implementation for the states not wishing to define an entry condition
// will not be called polymorphic way

View File

@@ -135,12 +135,12 @@ struct get_state_action_tag_type
template <class T,class EVT,class FSM,class SourceState,class TargetState>
struct get_result_type
{
typedef typename T::template transition_action_result<EVT,FSM,SourceState,TargetState>::type type;
typedef typename T::template transition_action_result<EVT,FSM,SourceState,TargetState>::type type;
};
template <class T,class Event,class FSM,class STATE>
struct get_result_type2
{
typedef typename T::template state_action_result<Event,FSM,STATE>::type type;
typedef typename T::template state_action_result<Event,FSM,STATE>::type type;
};
template<class SEQ>
struct get_sequence
@@ -316,7 +316,7 @@ struct make_invalid_type
template <class ROW>
struct make_vector_one_row
{
typedef boost::mpl::vector<ROW> type;
typedef boost::mpl::vector<ROW> type;
};
template <class T>
T make_T(T t) {return t;}
@@ -369,29 +369,29 @@ struct GetSource_ : euml_action<GetSource_<Index> >
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& ,SourceState& src,TargetState&)const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& ,SourceState& src,TargetState&)const
{
return src.get_attribute(Index());
}
}
};
template<>
struct GetSource_<void> : euml_action<GetSource_<void> >
{
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef SourceState& type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef SourceState& type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
{
return src;
}
}
};
struct get_source_tag {};
struct GetSource_Helper: proto::extends< proto::terminal<get_source_tag>::type, GetSource_Helper, sm_domain>
@@ -419,29 +419,29 @@ struct GetTarget_ : euml_action<GetTarget_<Index> >
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
{
return tgt.get_attribute(Index());
}
}
};
template<>
struct GetTarget_<void> : euml_action<GetTarget_<void> >
{
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef TargetState& type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef TargetState& type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& , FSM&,SourceState& ,TargetState& tgt)const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& , FSM&,SourceState& ,TargetState& tgt)const
{
return tgt;
}
}
};
struct get_target_tag {};
struct GetTarget_Helper: proto::extends< proto::terminal<get_target_tag>::type, GetTarget_Helper, sm_domain>
@@ -472,28 +472,28 @@ struct GetState_ : euml_action<GetState_<Index> >
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const&,FSM& ,STATE& state )
{
{
return state.get_attribute(Index());
}
}
};
template<>
struct GetState_<void> : euml_action<GetState_<void> >
{
using euml_action<GetState_ >::operator=;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef STATE& type;
};
typedef ::boost::mpl::set<state_action_tag> tag_type;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef STATE& type;
};
typedef ::boost::mpl::set<state_action_tag> tag_type;
template <class Event,class FSM,class STATE>
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const&,FSM& ,STATE& state )
{
{
return state;
}
}
};
struct get_state_tag {};
struct GetState_Helper: proto::extends< proto::terminal<get_state_tag>::type, GetState_Helper, sm_domain>
@@ -529,46 +529,46 @@ struct GetEvent_ : euml_action<GetEvent_<Index> >
};
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const& evt,FSM& ,STATE& )
{
return evt.get_attribute(Index());
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
{
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const& evt,FSM& ,STATE& )
{
return evt.get_attribute(Index());
}
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
{
return evt.get_attribute(Index());
}
};
template <>
struct GetEvent_<void> : euml_action<GetEvent_<void> >
{
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef Event const& type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef EVT const& type;
};
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef Event const& type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef EVT const& type;
};
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const& evt,FSM& ,STATE& )
{
return evt;
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
{
return evt;
}
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const& evt,FSM& ,STATE& )
{
return evt;
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
{
return evt;
}
};
struct get_event_tag {};
struct GetEvent_Helper: proto::extends< proto::terminal<get_event_tag>::type, GetEvent_Helper, sm_domain>
@@ -608,12 +608,12 @@ struct GetFsm_ : euml_action<GetFsm_<Index> >
{
return fsm.get_attribute(Index());
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
{
return fsm.get_attribute(Index());
}
}
};
template<>
struct GetFsm_<void> : euml_action<GetFsm_<void> >
@@ -739,7 +739,7 @@ struct GetAttribute_ : euml_action<GetAttribute_<Target, Index> >
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename
typedef typename
::boost::fusion::result_of::at_key<
typename get_attributes_type<
typename ::boost::remove_reference<
@@ -749,7 +749,7 @@ struct GetAttribute_ : euml_action<GetAttribute_<Target, Index> >
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename
typedef typename
::boost::fusion::result_of::at_key<
typename get_attributes_type<
typename ::boost::remove_reference<
@@ -760,19 +760,19 @@ struct GetAttribute_ : euml_action<GetAttribute_<Target, Index> >
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Target::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Target::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return (Target()(evt,fsm,src,tgt)).get_attribute(Index());
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Target::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Target::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return (Target()(evt,fsm,state)).get_attribute(Index());
@@ -800,117 +800,117 @@ template <class Index>
struct Source_ : euml_action<Source_<Index> >
{
using euml_action<Source_<Index> >::operator=;
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename SourceState::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename SourceState::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
{
return src.get_attribute(Index());
}
}
};
template <class Index>
struct Target_ : euml_action<Target_<Index> >
{
using euml_action<Target_<Index> >::operator=;
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename TargetState::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename TargetState::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
{
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
{
return tgt.get_attribute(Index());
}
}
};
template <class Index>
struct State_ : euml_action<State_<Index> >
{
using euml_action<State_<Index> >::operator=;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename STATE::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<state_action_tag> tag_type;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename STATE::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<state_action_tag> tag_type;
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const&,FSM& ,STATE& state )
{
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const&,FSM& ,STATE& state )
{
return state.get_attribute(Index());
}
}
};
template <class Index>
struct Event_ : euml_action<Event_<Index> >
{
using euml_action<Event_<Index> >::operator=;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename ::boost::add_const<
typename ::boost::fusion::result_of::at_key<typename Event::attributes_type,
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename ::boost::add_const<
typename ::boost::fusion::result_of::at_key<typename Event::attributes_type,
Index >::type>::type type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename ::boost::add_const<
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename ::boost::add_const<
typename ::boost::fusion::result_of::at_key<typename EVT::attributes_type,
Index >::type>::type type;
};
};
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const& evt,FSM& ,STATE& )
{
return evt.get_attribute(Index());
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
{
return evt.get_attribute(Index());
}
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const& evt,FSM& ,STATE& )
{
return evt.get_attribute(Index());
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
{
return evt.get_attribute(Index());
}
};
template <class StateType,class Index>
struct State_Attribute_ : euml_action<State_Attribute_<StateType,Index> >
{
using euml_action<State_Attribute_<StateType,Index> >::operator=;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename StateType::attributes_type,
Index >::type type;
};
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename
::boost::fusion::result_of::at_key<typename StateType::attributes_type,
Index >::type type;
};
typedef ::boost::mpl::set<state_action_tag> tag_type;
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const&,FSM& fsm,STATE& )
{
template <class Event,class FSM,class STATE>
typename state_action_result<Event,FSM,STATE>::type
operator()(Event const&,FSM& fsm,STATE& )
{
return fsm.template get_state<StateType&>().get_attribute(Index());
}
}
};
template <class Index>

File diff suppressed because it is too large Load Diff

View File

@@ -17,4 +17,4 @@
#include <boost/msm/front/euml/state_grammar.hpp>
#include <boost/msm/front/euml/stt_grammar.hpp>
#endif //BOOST_MSM_FRONT_EUML_EUML_H
#endif //BOOST_MSM_FRONT_EUML_EUML_H

View File

@@ -118,4 +118,4 @@ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::GreaterEqual_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::EqualTo_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::NotEqualTo_, 2)
#endif //BOOST_MSM_FRONT_EUML_TYPEOF_H
#endif //BOOST_MSM_FRONT_EUML_TYPEOF_H

View File

@@ -22,246 +22,246 @@ struct BuildActions;
struct BuildGuardsCases
{
// The primary template matches nothing:
template<typename Tag>
struct case_
: proto::not_<proto::_>
{};
// The primary template matches nothing:
template<typename Tag>
struct case_
: proto::not_<proto::_>
{};
};
template<>
struct BuildGuardsCases::case_<proto::tag::logical_or>
: proto::when<
: proto::when<
proto::logical_or<BuildGuards,BuildGuards >,
Or_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::logical_and>
: proto::when<
: proto::when<
proto::logical_and<BuildGuards,BuildGuards >,
And_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::logical_not>
: proto::when<
: proto::when<
proto::logical_not<BuildGuards >,
Not_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::less>
: proto::when<
: proto::when<
proto::less<BuildGuards, BuildGuards >,
Less_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::less_equal>
: proto::when<
: proto::when<
proto::less_equal<BuildGuards, BuildGuards >,
LessEqual_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::greater>
: proto::when<
: proto::when<
proto::greater<BuildGuards, BuildGuards >,
Greater_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::greater_equal>
: proto::when<
: proto::when<
proto::greater_equal<BuildGuards, BuildGuards >,
GreaterEqual_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::equal_to>
: proto::when<
proto::equal_to<BuildGuards, BuildGuards >,
EqualTo_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
: proto::when<
proto::equal_to<BuildGuards, BuildGuards >,
EqualTo_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::not_equal_to>
: proto::when<
proto::not_equal_to<BuildGuards, BuildGuards >,
NotEqualTo_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
: proto::when<
proto::not_equal_to<BuildGuards, BuildGuards >,
NotEqualTo_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::pre_inc>
: proto::when<
: proto::when<
proto::pre_inc<BuildGuards >,
Pre_inc_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::dereference>
: proto::when<
: proto::when<
proto::dereference<BuildGuards >,
Deref_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::pre_dec>
: proto::when<
: proto::when<
proto::pre_dec<BuildGuards >,
Pre_dec_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::post_inc>
: proto::when<
: proto::when<
proto::post_inc<BuildGuards >,
Post_inc_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::post_dec>
: proto::when<
: proto::when<
proto::post_dec<BuildGuards >,
Post_dec_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::plus>
: proto::when<
: proto::when<
proto::plus<BuildGuards,BuildGuards >,
Plus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::minus>
: proto::when<
: proto::when<
proto::minus<BuildGuards,BuildGuards >,
Minus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::multiplies>
: proto::when<
: proto::when<
proto::multiplies<BuildGuards,BuildGuards >,
Multiplies_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::divides>
: proto::when<
: proto::when<
proto::divides<BuildGuards,BuildGuards >,
Divides_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::modulus>
: proto::when<
: proto::when<
proto::modulus<BuildGuards,BuildGuards >,
Modulus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::bitwise_and>
: proto::when<
: proto::when<
proto::bitwise_and<BuildGuards,BuildGuards >,
Bitwise_And_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::bitwise_or>
: proto::when<
: proto::when<
proto::bitwise_or<BuildGuards,BuildGuards >,
Bitwise_Or_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::subscript>
: proto::when<
: proto::when<
proto::subscript<BuildGuards,BuildGuards >,
Subscript_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::plus_assign>
: proto::when<
: proto::when<
proto::plus_assign<BuildGuards,BuildGuards >,
Plus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::minus_assign>
: proto::when<
: proto::when<
proto::minus_assign<BuildGuards,BuildGuards >,
Minus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::multiplies_assign>
: proto::when<
: proto::when<
proto::multiplies_assign<BuildGuards,BuildGuards >,
Multiplies_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::divides_assign>
: proto::when<
: proto::when<
proto::divides_assign<BuildGuards,BuildGuards >,
Divides_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::modulus_assign>
: proto::when<
: proto::when<
proto::modulus_assign<BuildGuards,BuildGuards >,
Modulus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::shift_left_assign>
: proto::when<
: proto::when<
proto::shift_left_assign<BuildGuards,BuildGuards >,
ShiftLeft_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::shift_right_assign>
: proto::when<
: proto::when<
proto::shift_right_assign<BuildGuards,BuildGuards >,
ShiftRight_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::shift_left>
: proto::when<
: proto::when<
proto::shift_left<BuildGuards,BuildGuards >,
ShiftLeft_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::shift_right>
: proto::when<
: proto::when<
proto::shift_right<BuildGuards,BuildGuards >,
ShiftRight_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::assign>
: proto::when<
: proto::when<
proto::assign<BuildGuards,BuildGuards >,
Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::bitwise_xor>
: proto::when<
: proto::when<
proto::bitwise_xor<BuildGuards,BuildGuards >,
Bitwise_Xor_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::negate>
: proto::when<
: proto::when<
proto::negate<BuildGuards >,
Unary_Minus_<BuildGuards(proto::_child)>()
>
@@ -269,42 +269,42 @@ struct BuildGuardsCases::case_<proto::tag::negate>
template<>
struct BuildGuardsCases::case_<proto::tag::function>
: proto::or_<
proto::when<
proto::function<proto::terminal<if_tag>,BuildGuards,BuildGuards,BuildGuards >,
: proto::or_<
proto::when<
proto::function<proto::terminal<if_tag>,BuildGuards,BuildGuards,BuildGuards >,
If_Else_<BuildGuards(proto::_child_c<1>),
BuildGuards(proto::_child_c<2>),
BuildGuards(proto::_child_c<3>) >()
>,
BuildGuards(proto::_child_c<2>),
BuildGuards(proto::_child_c<3>) >()
>,
proto::when<
proto::function<proto::terminal<proto::_> >,
get_fct<proto::_child_c<0> >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions >,
get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>)
,BuildActions(proto::_child_c<2>),BuildActions(proto::_child_c<3>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>
,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>) >()
>,
proto::when<
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>
,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>),BuildActions(proto::_child_c<5>) >()
>
>
#ifdef BOOST_MSVC
,proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
@@ -312,18 +312,18 @@ struct BuildGuardsCases::case_<proto::tag::function>
,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>)
,BuildActions(proto::_child_c<5>),BuildActions(proto::_child_c<6>) >()
>
>
#endif
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::terminal>
: proto::or_<
: proto::or_<
proto::when <
proto::terminal<action_tag>,
get_action_name<proto::_ >()
>,
proto::terminal<action_tag>,
get_action_name<proto::_ >()
>,
proto::when<
proto::terminal<state_tag>,
proto::_
@@ -340,7 +340,7 @@ struct BuildGuardsCases::case_<proto::tag::terminal>
{};
struct BuildGuards
: proto::switch_<BuildGuardsCases>
: proto::switch_<BuildGuardsCases>
{};
}}}}

File diff suppressed because it is too large Load Diff

View File

@@ -39,7 +39,7 @@ namespace boost { namespace msm { namespace front { namespace euml
template<class StateNameTag,
class EntryFunctor=NoAction,
class ExitFunctor=NoAction,
class Attributes= ::boost::fusion::vector<>,
class Attributes= ::boost::fusion::vector<>,
class Flags = ::boost::mpl::vector0<>,
class Defer = ::boost::mpl::vector0<>,
class BASE = ::boost::msm::front::default_base_state>
@@ -56,16 +56,16 @@ struct func_state : public ::boost::msm::front::detail::state_base<BASE,Attribu
// deferred events
typedef Defer deferred_events;
template <class Event,class FSM>
void on_entry(Event const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_exit(Event const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_entry(Event const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_exit(Event const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
};
// provides the typedefs and interface. Concrete states derive from it.
@@ -73,7 +73,7 @@ template<class StateNameTag,
int ZoneIndex=-1,
class EntryFunctor=NoAction,
class ExitFunctor=NoAction,
class Attributes= ::boost::fusion::vector<>,
class Attributes= ::boost::fusion::vector<>,
class Flags = ::boost::mpl::vector0<>,
class Defer = ::boost::mpl::vector0<>,
class BASE = default_base_state>
@@ -95,23 +95,23 @@ struct entry_func_state : public ::boost::msm::front::detail::state_base<BASE,A
// deferred events
typedef Defer deferred_events;
template <class Event,class FSM>
void on_entry(Event const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_exit(Event const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_entry(Event const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_exit(Event const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
};
// provides the typedefs and interface. Concrete states derive from it.
template<class StateNameTag,
int ZoneIndex=-1,
class EntryFunctor=NoAction,
class ExitFunctor=NoAction,
class Attributes= ::boost::fusion::vector<>,
class Attributes= ::boost::fusion::vector<>,
class Flags = ::boost::mpl::vector0<>,
class Defer = ::boost::mpl::vector0<>,
class BASE = default_base_state>
@@ -130,16 +130,16 @@ struct explicit_entry_func_state : public ::boost::msm::front::detail::state_ba
// deferred events
typedef Defer deferred_events;
template <class Event,class FSM>
void on_entry(Event const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_exit(Event const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_entry(Event const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Event,class FSM>
void on_exit(Event const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
};
// provides the typedefs and interface. Concrete states derive from it.
@@ -147,7 +147,7 @@ template<class StateNameTag,
class Event,
class EntryFunctor=NoAction,
class ExitFunctor=NoAction,
class Attributes= ::boost::fusion::vector<>,
class Attributes= ::boost::fusion::vector<>,
class Flags = ::boost::mpl::vector0<>,
class Defer = ::boost::mpl::vector0<>,
class BASE = default_base_state>
@@ -169,16 +169,16 @@ struct exit_func_state : public ::boost::msm::front::detail::state_base<BASE,A
// deferred events
typedef Defer deferred_events;
template <class Evt,class FSM>
void on_entry(Evt const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Evt,class FSM>
void on_exit(Evt const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
template <class Evt,class FSM>
void on_entry(Evt const& evt,FSM& fsm)
{
EntryFunctor()(evt,fsm,*this);
}
template <class Evt,class FSM>
void on_exit(Evt const& evt,FSM& fsm)
{
ExitFunctor()(evt,fsm,*this);
}
};
struct BuildActions;
@@ -194,273 +194,273 @@ struct BuildActionSequence
proto::comma<BuildActions,BuildActions >,
ActionSequence_<boost::mpl::push_back<
make_vector_one_row<BuildActions(proto::_left)>(),
BuildActions(proto::_right)>()>()
>,
BuildActions(proto::_right)>()>()
>,
proto::when <
proto::comma<BuildActionSequence,BuildActions >,
ActionSequence_<boost::mpl::push_back<
get_sequence<BuildActionSequence(proto::_left) >(),
BuildActions(proto::_right) >() >()
>
BuildActions(proto::_right) >() >()
>
>
{};
struct BuildActionsCases
{
// The primary template matches nothing:
template<typename Tag>
struct case_
: proto::not_<proto::_>
{};
// The primary template matches nothing:
template<typename Tag>
struct case_
: proto::not_<proto::_>
{};
};
template<>
struct BuildActionsCases::case_<proto::tag::pre_inc>
: proto::when<
: proto::when<
proto::pre_inc<BuildActions >,
Pre_inc_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::pre_dec>
: proto::when<
: proto::when<
proto::pre_dec<BuildActions >,
Pre_dec_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::post_inc>
: proto::when<
: proto::when<
proto::post_inc<BuildActions >,
Post_inc_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::post_dec>
: proto::when<
: proto::when<
proto::post_dec<BuildActions >,
Post_dec_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::dereference>
: proto::when<
: proto::when<
proto::dereference<BuildActions >,
Deref_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::plus>
: proto::when<
: proto::when<
proto::plus<BuildActions,BuildActions >,
Plus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::minus>
: proto::when<
: proto::when<
proto::minus<BuildActions,BuildActions >,
Minus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::multiplies>
: proto::when<
: proto::when<
proto::multiplies<BuildActions,BuildActions >,
Multiplies_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::divides>
: proto::when<
: proto::when<
proto::divides<BuildActions,BuildActions >,
Divides_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::modulus>
: proto::when<
: proto::when<
proto::modulus<BuildActions,BuildActions >,
Modulus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::bitwise_and>
: proto::when<
: proto::when<
proto::bitwise_and<BuildActions,BuildActions >,
Bitwise_And_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::bitwise_or>
: proto::when<
: proto::when<
proto::bitwise_or<BuildActions,BuildActions >,
Bitwise_Or_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::bitwise_xor>
: proto::when<
: proto::when<
proto::bitwise_xor<BuildActions,BuildActions >,
Bitwise_Xor_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::plus_assign>
: proto::when<
: proto::when<
proto::plus_assign<BuildActions,BuildActions >,
Plus_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::minus_assign>
: proto::when<
: proto::when<
proto::minus_assign<BuildActions,BuildActions >,
Minus_Assign_<BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::multiplies_assign>
: proto::when<
: proto::when<
proto::multiplies_assign<BuildActions,BuildActions >,
Multiplies_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::divides_assign>
: proto::when<
: proto::when<
proto::divides_assign<BuildActions,BuildActions >,
Divides_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::modulus_assign>
: proto::when<
: proto::when<
proto::modulus_assign<BuildActions,BuildActions >,
Modulus_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::shift_left_assign>
: proto::when<
: proto::when<
proto::shift_left_assign<BuildActions,BuildActions >,
ShiftLeft_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::shift_right_assign>
: proto::when<
: proto::when<
proto::shift_right_assign<BuildActions,BuildActions >,
ShiftRight_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::shift_left>
: proto::when<
: proto::when<
proto::shift_left<BuildActions,BuildActions >,
ShiftLeft_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::shift_right>
: proto::when<
: proto::when<
proto::shift_right<BuildActions,BuildActions >,
ShiftRight_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::assign>
: proto::when<
: proto::when<
proto::assign<BuildActions,BuildActions >,
Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::subscript>
: proto::when<
: proto::when<
proto::subscript<BuildActions,BuildActions >,
Subscript_< BuildActions(proto::_left),BuildActions(proto::_right)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::unary_plus>
: proto::when<
: proto::when<
proto::unary_plus<BuildActions >,
Unary_Plus_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::negate>
: proto::when<
: proto::when<
proto::negate<BuildActions >,
Unary_Minus_< BuildActions(proto::_child)>()
>
>
{};
template<>
struct BuildActionsCases::case_<proto::tag::function>
: proto::or_<
proto::when<
proto::function<proto::terminal<if_tag>,BuildGuards,BuildActionSequence,BuildActionSequence >,
proto::function<proto::terminal<if_tag>,BuildGuards,BuildActionSequence,BuildActionSequence >,
If_Else_<BuildGuards(proto::_child_c<1>),
BuildActionSequence(proto::_child_c<2>),
BuildActionSequence(proto::_child_c<3>) >()
>,
BuildActionSequence(proto::_child_c<2>),
BuildActionSequence(proto::_child_c<3>) >()
>,
proto::when<
proto::function<proto::terminal<if_then_tag>,BuildGuards,BuildActionSequence >,
proto::function<proto::terminal<if_then_tag>,BuildGuards,BuildActionSequence >,
If_Then_<BuildGuards(proto::_child_c<1>),
BuildActionSequence(proto::_child_c<2>)>()
>,
proto::when<
proto::function<proto::terminal<while_do_tag>,BuildGuards,BuildActionSequence >,
While_Do_<BuildGuards(proto::_child_c<1>),
BuildActionSequence(proto::_child_c<2>) >()
>,
proto::when<
proto::function<proto::terminal<do_while_tag>,BuildGuards,BuildActionSequence >,
Do_While_<BuildGuards(proto::_child_c<1>),
BuildActionSequence(proto::_child_c<2>) >()
>,
BuildActionSequence(proto::_child_c<2>)>()
>,
proto::when<
proto::function<proto::terminal<for_loop_tag>,
proto::function<proto::terminal<while_do_tag>,BuildGuards,BuildActionSequence >,
While_Do_<BuildGuards(proto::_child_c<1>),
BuildActionSequence(proto::_child_c<2>) >()
>,
proto::when<
proto::function<proto::terminal<do_while_tag>,BuildGuards,BuildActionSequence >,
Do_While_<BuildGuards(proto::_child_c<1>),
BuildActionSequence(proto::_child_c<2>) >()
>,
proto::when<
proto::function<proto::terminal<for_loop_tag>,
BuildActionSequence,BuildGuards,BuildActionSequence,BuildActionSequence>,
For_Loop_<BuildActionSequence(proto::_child_c<1>),
BuildGuards(proto::_child_c<2>),
BuildActionSequence(proto::_child_c<3>),
BuildGuards(proto::_child_c<2>),
BuildActionSequence(proto::_child_c<3>),
BuildActionSequence(proto::_child_c<4>) >()
>,
>,
proto::or_<
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions >,
get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_> >,
get_fct<proto::_child_c<0> >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>)
,BuildActions(proto::_child_c<2>),BuildActions(proto::_child_c<3>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>
,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>) >()
>,
>,
proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
get_fct<proto::_child_c<0>
,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>)
,BuildActions(proto::_child_c<5>) >()
>
>
#ifdef BOOST_MSVC
,proto::when<
proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
@@ -468,7 +468,7 @@ struct BuildActionsCases::case_<proto::tag::function>
,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>)
,BuildActions(proto::_child_c<5>),BuildActions(proto::_child_c<6>) >()
>
>
#endif
>
>
@@ -496,11 +496,11 @@ struct BuildActionsCases::case_<proto::tag::terminal>
proto::when<
proto::terminal<proto::_>,
get_fct<proto::_ >()
>
>
>
{};
struct BuildActions
: proto::switch_<BuildActionsCases>
: proto::switch_<BuildActionsCases>
{};
// attributes building
@@ -677,8 +677,8 @@ BASE
>
build_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
@@ -703,12 +703,12 @@ typename boost::result_of<BuildDeferred(Configure)>::type
>
build_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
}
template <class StateNameTag,class Expr1,class Expr2,class Attr>
@@ -727,10 +727,10 @@ typename boost::result_of<BuildAttributes(Attr)>::type
>
build_state(Expr1 const& ,Expr2 const& ,Attr const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
return func_state<StateNameTag,entry_action,exit_action,attributes_type>();
return func_state<StateNameTag,entry_action,exit_action,attributes_type>();
}
template <class StateNameTag,class Expr1,class Expr2>
@@ -748,9 +748,9 @@ typename ::boost::mpl::eval_if<
>
build_state(Expr1 const& ,Expr2 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return func_state<StateNameTag,entry_action,exit_action>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return func_state<StateNameTag,entry_action,exit_action>();
}
template <class StateNameTag,class Expr1>
@@ -765,8 +765,8 @@ NoAction
>
build_state(Expr1 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return func_state<StateNameTag,entry_action,NoAction>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return func_state<StateNameTag,entry_action,NoAction>();
}
template<class StateNameTag>
inline
@@ -777,7 +777,7 @@ NoAction
>
build_state()
{
return func_state<StateNameTag,NoAction,NoAction>();
return func_state<StateNameTag,NoAction,NoAction>();
}
// provides the typedefs and interface. Concrete states derive from it.
@@ -810,7 +810,7 @@ struct func_state_machine : public ::boost::msm::front::detail::state_base<BASE
// deferred events
typedef Defer deferred_events;
// customization (message queue, exceptions)
typedef Configuration configuration;
typedef Configuration configuration;
typedef BASE BaseAllStates;
@@ -1065,8 +1065,8 @@ BASE
build_sm(STT ,Init , Expr1 const& ,Expr2 const& ,Attr const& , Configure const&, Expr3 const&, Expr4 const& , BASE )
{
typedef typename boost::result_of<BuildInit(Init)>::type init_type;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildConfigure(Configure)>::type config_type;
@@ -1105,8 +1105,8 @@ BASE
>
build_terminate_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename ::boost::mpl::push_back<
typename boost::result_of<BuildFlags(Configure)>::type,
::boost::msm::TerminateFlag >::type flags_type;
@@ -1134,8 +1134,8 @@ typename boost::result_of<BuildDeferred(Configure)>::type
>
build_terminate_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename ::boost::mpl::push_back<
typename boost::result_of<BuildFlags(Configure)>::type,
::boost::msm::TerminateFlag >::type flags_type;
@@ -1162,10 +1162,10 @@ typename boost::result_of<BuildAttributes(Attr)>::type,
>
build_terminate_state(Expr1 const& ,Expr2 const& ,Attr const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
return func_state<StateNameTag,entry_action,exit_action,attributes_type, ::boost::mpl::vector< ::boost::msm::TerminateFlag> >();
return func_state<StateNameTag,entry_action,exit_action,attributes_type, ::boost::mpl::vector< ::boost::msm::TerminateFlag> >();
}
template <class StateNameTag,class Expr1,class Expr2>
@@ -1185,9 +1185,9 @@ typename ::boost::mpl::eval_if<
>
build_terminate_state(Expr1 const& ,Expr2 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return func_state<StateNameTag,entry_action,exit_action,
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return func_state<StateNameTag,entry_action,exit_action,
::boost::fusion::vector<>, ::boost::mpl::vector< ::boost::msm::TerminateFlag> >();
}
@@ -1205,8 +1205,8 @@ NoAction,
>
build_terminate_state(Expr1 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return func_state<StateNameTag,entry_action,NoAction,::boost::fusion::vector<>,::boost::mpl::vector<boost::msm::TerminateFlag> >();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return func_state<StateNameTag,entry_action,NoAction,::boost::fusion::vector<>,::boost::mpl::vector<boost::msm::TerminateFlag> >();
}
template<class StateNameTag>
inline
@@ -1245,8 +1245,8 @@ BASE
>
build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
typedef typename ::boost::mpl::push_back<
typename ::boost::mpl::push_back<
@@ -1280,8 +1280,8 @@ typename boost::result_of<BuildDeferred(Configure)>::type
>
build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
typedef typename ::boost::mpl::push_back<
@@ -1292,7 +1292,7 @@ build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& ,Attr
>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
}
template <class StateNameTag,class Expr1,class Expr2,class Attr,class EndInterruptEvent>
@@ -1312,10 +1312,10 @@ typename boost::result_of<BuildAttributes(Attr)>::type,
>
build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& ,Attr const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
return func_state<StateNameTag,entry_action,exit_action,attributes_type,
return func_state<StateNameTag,entry_action,exit_action,attributes_type,
::boost::mpl::vector< boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
}
@@ -1336,9 +1336,9 @@ typename ::boost::mpl::eval_if<
>
build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return func_state<StateNameTag,entry_action,exit_action,
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return func_state<StateNameTag,entry_action,exit_action,
::boost::fusion::vector<>,
::boost::mpl::vector< boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
}
@@ -1357,8 +1357,8 @@ NoAction,
>
build_interrupt_state(EndInterruptEvent const&, Expr1 const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return func_state<StateNameTag,entry_action,NoAction, ::boost::fusion::vector<>,
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return func_state<StateNameTag,entry_action,NoAction, ::boost::fusion::vector<>,
::boost::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
}
@@ -1397,8 +1397,8 @@ BASE
>
build_entry_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
@@ -1424,8 +1424,8 @@ typename boost::result_of<BuildDeferred(Configure)>::type
>
build_entry_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
@@ -1449,10 +1449,10 @@ typename boost::result_of<BuildAttributes(Attr)>::type
>
build_entry_state(Expr1 const& ,Expr2 const& ,Attr const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type>();
return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type>();
}
template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2>
@@ -1471,9 +1471,9 @@ typename ::boost::mpl::eval_if<
>
build_entry_state(Expr1 const& ,Expr2 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action>();
}
template <class StateNameTag,int ZoneIndex,class Expr1>
@@ -1489,8 +1489,8 @@ NoAction
>
build_entry_state(Expr1 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return entry_func_state<StateNameTag,ZoneIndex,entry_action,NoAction>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return entry_func_state<StateNameTag,ZoneIndex,entry_action,NoAction>();
}
template <class StateNameTag,int ZoneIndex>
@@ -1503,7 +1503,7 @@ NoAction
>
build_entry_state()
{
return entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
return entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
}
template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr,class Configure,class BASE>
@@ -1526,8 +1526,8 @@ BASE
>
build_exit_state(Event const&,Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
@@ -1553,8 +1553,8 @@ typename boost::result_of<BuildDeferred(Configure)>::type
>
build_exit_state(Event const&,Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
@@ -1578,10 +1578,10 @@ typename boost::result_of<BuildAttributes(Attr)>::type
>
build_exit_state(Event const&,Expr1 const& ,Expr2 const& ,Attr const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
return exit_func_state<StateNameTag,Event,entry_action,exit_action,attributes_type>();
return exit_func_state<StateNameTag,Event,entry_action,exit_action,attributes_type>();
}
template <class StateNameTag,class Event,class Expr1,class Expr2>
@@ -1600,9 +1600,9 @@ typename ::boost::mpl::eval_if<
>
build_exit_state(Event const&,Expr1 const& ,Expr2 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return exit_func_state<StateNameTag,Event,entry_action,exit_action>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return exit_func_state<StateNameTag,Event,entry_action,exit_action>();
}
template <class StateNameTag,class Event,class Expr1>
@@ -1618,8 +1618,8 @@ NoAction
>
build_exit_state(Event const&, Expr1 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return exit_func_state<StateNameTag,Event,entry_action,NoAction>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return exit_func_state<StateNameTag,Event,entry_action,NoAction>();
}
template <class StateNameTag,class Event>
@@ -1632,7 +1632,7 @@ NoAction
>
build_exit_state(Event const&)
{
return exit_func_state<StateNameTag,Event,NoAction,NoAction>();
return exit_func_state<StateNameTag,Event,NoAction,NoAction>();
}
template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure,class BASE>
@@ -1655,8 +1655,8 @@ BASE
>
build_explicit_entry_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
@@ -1682,8 +1682,8 @@ typename boost::result_of<BuildDeferred(Configure)>::type
>
build_explicit_entry_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
@@ -1707,10 +1707,10 @@ typename boost::result_of<BuildAttributes(Attr)>::type
>
build_explicit_entry_state(Expr1 const& ,Expr2 const& ,Attr const&)
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type>();
return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type>();
}
template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2>
@@ -1729,9 +1729,9 @@ typename ::boost::mpl::eval_if<
>
build_explicit_entry_state(Expr1 const& ,Expr2 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
typedef typename boost::result_of<BuildActionSequence(Expr2)>::type exit_action;
return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action>();
}
template <class StateNameTag,int ZoneIndex,class Expr1>
@@ -1747,8 +1747,8 @@ NoAction
>
build_explicit_entry_state(Expr1 const& )
{
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,NoAction>();
typedef typename boost::result_of<BuildActionSequence(Expr1)>::type entry_action;
return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,NoAction>();
}
template <class StateNameTag,int ZoneIndex>
@@ -1761,7 +1761,7 @@ NoAction
>
build_explicit_entry_state()
{
return explicit_entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
return explicit_entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
}

View File

@@ -14,4 +14,4 @@
#include <boost/msm/front/euml/container.hpp>
#include <boost/msm/front/euml/algorithm.hpp>
#endif //BOOST_MSM_FRONT_EUML_STL_H
#endif //BOOST_MSM_FRONT_EUML_STL_H

View File

@@ -75,8 +75,8 @@ struct BuildNextStates
proto::comma<BuildNextStates,BuildEntry >,
::boost::mpl::push_back<
BuildNextStates(proto::_left),
BuildEntry(proto::_right) >()
>
BuildEntry(proto::_right) >()
>
>
{};
@@ -141,7 +141,7 @@ struct BuildEvent
, proto::when<
proto::divides<proto::terminal<event_tag>,BuildActionSequence >,
TempRow<none,proto::_left,none,
BuildActionSequence(proto::_right) >() >
BuildActionSequence(proto::_right) >() >
// event [ guard ]
, proto::when<
proto::subscript<proto::terminal<event_tag>,BuildGuards >,
@@ -166,7 +166,7 @@ struct BuildSource
, proto::when<
proto::divides<BuildSourceState,BuildActionSequence >,
TempRow<BuildSourceState(proto::_left),none,none,
BuildActionSequence(proto::_right) >() >
BuildActionSequence(proto::_right) >() >
// == source [ guard ]
, proto::when<
proto::subscript<BuildSourceState,BuildGuards >,

View File

@@ -87,23 +87,23 @@ struct BackInserter_ : euml_action<BackInserter_<T> >
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::back_inserter(T()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::back_inserter(T()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::back_inserter(T()(evt,fsm,state));
}
}
};
struct back_inserter_tag {};
@@ -141,23 +141,23 @@ struct FrontInserter_ : euml_action<FrontInserter_<T> >
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::front_inserter(T()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::front_inserter(T()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::front_inserter(T()(evt,fsm,state));
}
}
};
struct front_inserter_tag {};
@@ -195,23 +195,23 @@ struct Inserter_ : euml_action<Inserter_<T,Pos> >
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::inserter(T()(evt,fsm,src,tgt),Pos()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::inserter(T()(evt,fsm,src,tgt),Pos()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename T::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::inserter(T()(evt,fsm,state),Pos()(evt,fsm,state));
}
}
};
struct inserter_tag {};
@@ -252,20 +252,20 @@ struct Transform_<Param1,Param2,Param3,Param4,Param5,
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::transform(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt),
Param4()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::transform(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state),
@@ -291,20 +291,20 @@ struct Transform_<Param1,Param2,Param3,Param4,Param5,
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class SourceState,class TargetState>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,action_tag>::type,
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
{
return std::transform (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt),
Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));
}
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
template <class Event,class FSM,class STATE>
typename ::boost::enable_if<
typename ::boost::mpl::has_key<
typename Param1::tag_type,state_action_tag>::type,
typename state_action_result<Event,FSM,STATE>::type >::type
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::transform (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state),

View File

@@ -165,7 +165,7 @@ namespace boost { namespace msm { namespace front
template<class TGT>
struct get_row_target
{
typedef typename TGT::Target type;
typedef typename TGT::Target type;
};
template <class EVENT,class ACTION=none,class GUARD=none>

View File

@@ -19,15 +19,15 @@
namespace boost { namespace msm { namespace front
{
template<
class Event
template<
class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
>
struct a_internal
{
>
struct a_internal
{
typedef sm_a_i_row_tag row_type_tag;
typedef Event Evt;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -37,19 +37,19 @@ namespace boost { namespace msm { namespace front
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
}
};
};
template<
template<
class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct internal
{
>
struct internal
{
typedef sm_i_row_tag row_type_tag;
typedef Event Evt;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -68,16 +68,16 @@ namespace boost { namespace msm { namespace front
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
class Event
};
template<
class Event
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct g_internal
{
>
struct g_internal
{
typedef sm_g_i_row_tag row_type_tag;
typedef Event Evt;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -88,13 +88,13 @@ namespace boost { namespace msm { namespace front
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
class Event
>
struct _internal
{
template<
class Event
>
struct _internal
{
typedef sm__i_row_tag row_type_tag;
typedef Event Evt;
typedef Event Evt;
};
}}}

View File

@@ -19,32 +19,32 @@
namespace boost { namespace msm { namespace front
{
template<
typename T1
, class Event
, typename T2
>
struct _row2
{
template<
typename T1
, class Event
, typename T2
>
struct _row2
{
typedef _row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
};
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
};
template<
typename T1
, class Event
, typename T2
template<
typename T1
, class Event
, typename T2
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
>
struct a_row2
{
, void (CalledForAction::*action)(Event const&)
>
struct a_row2
{
typedef a_row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -54,23 +54,23 @@ namespace boost { namespace msm { namespace front
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
}
};
};
template<
typename T1
, class Event
, typename T2
template<
typename T1
, class Event
, typename T2
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct row2
{
>
struct row2
{
typedef row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState, class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -89,20 +89,20 @@ namespace boost { namespace msm { namespace front
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
typename T1
, class Event
, typename T2
};
template<
typename T1
, class Event
, typename T2
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct g_row2
{
>
struct g_row2
{
typedef g_row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -114,18 +114,18 @@ namespace boost { namespace msm { namespace front
}
};
// internal transitions
template<
typename T1
, class Event
template<
typename T1
, class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
>
struct a_irow2
{
>
struct a_irow2
{
typedef a_irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -135,22 +135,22 @@ namespace boost { namespace msm { namespace front
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
}
};
};
template<
typename T1
, class Event
template<
typename T1
, class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct irow2
{
>
struct irow2
{
typedef irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
@@ -169,19 +169,19 @@ namespace boost { namespace msm { namespace front
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
typename T1
, class Event
};
template<
typename T1
, class Event
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct g_irow2
{
>
struct g_irow2
{
typedef g_irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)

View File

@@ -26,61 +26,61 @@ namespace boost { namespace msm { namespace front
template<class Derived,class BaseState = default_base_state>
struct state_machine_def : public boost::msm::front::detail::state_base<BaseState>
{
// tags
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
// tags
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
// customization (message queue, exceptions)
typedef ::boost::mpl::vector0<> configuration;
typedef ::boost::mpl::vector0<> configuration;
typedef BaseState BaseAllStates;
template<
typename T1
, class Event
, typename T2
, void (Derived::*action)(Event const&)
>
struct a_row
{
template<
typename T1
, class Event
, typename T2
, void (Derived::*action)(Event const&)
>
struct a_row
{
typedef a_row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState&,TargetState&, AllStates&)
{
// in this front-end, we don't need to know source and target states
(fsm.*action)(evt);
}
};
};
template<
typename T1
, class Event
, typename T2
>
struct _row
{
template<
typename T1
, class Event
, typename T2
>
struct _row
{
typedef _row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
};
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
};
template<
typename T1
, class Event
, typename T2
, void (Derived::*action)(Event const&)
, bool (Derived::*guard)(Event const&)
>
struct row
{
template<
typename T1
, class Event
, typename T2
, void (Derived::*action)(Event const&)
, bool (Derived::*guard)(Event const&)
>
struct row
{
typedef row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState, class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
@@ -93,19 +93,19 @@ struct state_machine_def : public boost::msm::front::detail::state_base<BaseSta
// in this front-end, we don't need to know source and target states
return (fsm.*guard)(evt);
}
};
template<
typename T1
, class Event
, typename T2
, bool (Derived::*guard)(Event const&)
>
struct g_row
{
};
template<
typename T1
, class Event
, typename T2
, bool (Derived::*guard)(Event const&)
>
struct g_row
{
typedef g_row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
@@ -114,37 +114,37 @@ struct state_machine_def : public boost::msm::front::detail::state_base<BaseSta
}
};
// internal transitions
template<
typename T1
, class Event
, void (Derived::*action)(Event const&)
>
struct a_irow
{
template<
typename T1
, class Event
, void (Derived::*action)(Event const&)
>
struct a_irow
{
typedef a_irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
// in this front-end, we don't need to know source and target states
(fsm.*action)(evt);
}
};
};
template<
typename T1
, class Event
, void (Derived::*action)(Event const&)
, bool (Derived::*guard)(Event const&)
>
struct irow
{
template<
typename T1
, class Event
, void (Derived::*action)(Event const&)
, bool (Derived::*guard)(Event const&)
>
struct irow
{
typedef irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static void action_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
@@ -157,18 +157,18 @@ struct state_machine_def : public boost::msm::front::detail::state_base<BaseSta
// in this front-end, we don't need to know source and target states
return (fsm.*guard)(evt);
}
};
template<
typename T1
, class Event
, bool (Derived::*guard)(Event const&)
>
struct g_irow
{
};
template<
typename T1
, class Event
, bool (Derived::*guard)(Event const&)
>
struct g_irow
{
typedef g_irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
@@ -177,16 +177,16 @@ struct state_machine_def : public boost::msm::front::detail::state_base<BaseSta
}
};
// internal row withou action or guard. Does nothing except forcing the event to be ignored.
template<
typename T1
, class Event
>
struct _irow
{
template<
typename T1
, class Event
>
struct _irow
{
typedef _irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
};
protected:
// Default no-transition handler. Can be replaced in the Derived SM class.