Added boost header

This commit is contained in:
Christophe Riccio
2012-01-08 01:26:07 +00:00
parent 9c3faaca40
commit c7d752cdf8
8946 changed files with 1732316 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_COMMON_STATES_H
#define BOOST_MSM_FRONT_COMMON_STATES_H
#include <boost/mpl/int.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/include/at_c.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/msm/front/detail/common_states.hpp>
namespace boost { namespace msm { namespace front
{
// default base: non-polymorphic, not visitable
struct default_base_state
{
~default_base_state(){}
};
// default polymorphic base state. Derive all states from it to get polymorphic behavior
struct polymorphic_state
{
virtual ~polymorphic_state() {}
};
}}}
#endif //BOOST_MSM_FRONT_COMMON_STATES_H

View File

@@ -0,0 +1,31 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_COMMON_COMPLETION_EVENT_H
#define BOOST_MSM_FRONT_COMMON_COMPLETION_EVENT_H
namespace boost { namespace msm { namespace front
{
struct none
{
// make every event convertible to none.
// to support standard-conform implementation of pseudo exits.
none(){}
template <class Event>
none(Event const&){}
typedef int completion_event;
};
}}}
#endif //BOOST_MSM_FRONT_COMMON_COMPLETION_EVENT_H

View File

@@ -0,0 +1,77 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_DETAILS_COMMON_STATES_H
#define BOOST_MSM_FRONT_DETAILS_COMMON_STATES_H
#include <boost/mpl/int.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/include/at_key.hpp>
#include <boost/type_traits/add_const.hpp>
namespace boost { namespace msm { namespace front {namespace detail
{
template <class Attributes= ::boost::fusion::map<> >
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;
template <class Index>
typename ::boost::fusion::result_of::at_key<attributes_type,
Index>::type
get_attribute(Index const&)
{
return ::boost::fusion::at_key<Index>(m_attributes);
}
template <class Index>
typename ::boost::add_const<
typename ::boost::fusion::result_of::at_key<attributes_type,
Index>::type>::type
get_attribute(Index const&)const
{
return const_cast<
typename ::boost::add_const<
typename ::boost::fusion::result_of::at_key< attributes_type,
Index >::type>::type>
(::boost::fusion::at_key<Index>(m_attributes));
}
private:
// attributes
Attributes m_attributes;
};
// the interface for all states. Defines entry and exit functions. Overwrite to implement for any state needing it.
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;
// empty implementation for the states not wishing to define an entry condition
// will not be called polymorphic way
template <class Event,class FSM>
void on_entry(Event const& ,FSM&){}
template <class Event,class FSM>
void on_exit(Event const&,FSM& ){}
// default (empty) transition table;
typedef ::boost::mpl::vector0<> internal_transition_table;
typedef ::boost::mpl::vector0<> transition_table;
};
}}}}
#endif //BOOST_MSM_FRONT_DETAILS_COMMON_STATES_H

View File

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

View File

@@ -0,0 +1,19 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_ALGORITHM_H
#define BOOST_MSM_FRONT_EUML_ALGORITHM_H
#include <boost/msm/front/euml/iteration.hpp>
#include <boost/msm/front/euml/querying.hpp>
#include <boost/msm/front/euml/transformation.hpp>
#endif //BOOST_MSM_FRONT_EUML_ALGORITHM_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_EUML_H
#define BOOST_MSM_FRONT_EUML_EUML_H
#include <boost/msm/front/euml/common.hpp>
#include <boost/msm/front/euml/operator.hpp>
#include <boost/msm/front/euml/guard_grammar.hpp>
#include <boost/msm/front/euml/state_grammar.hpp>
#include <boost/msm/front/euml/stt_grammar.hpp>
#ifdef BOOST_MSM_EUML_PHOENIX_SUPPORT
#include <boost/msm/front/euml/phoenix_placeholders.hpp>
#endif
#endif //BOOST_MSM_FRONT_EUML_EUML_H

View File

@@ -0,0 +1,121 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_TYPEOF_H
#define BOOST_MSM_FRONT_EUML_TYPEOF_H
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(::boost::mpl::vector0, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(::boost::mpl::vector50, 50)
BOOST_TYPEOF_REGISTER_TYPE(::boost::mpl::na)
BOOST_TYPEOF_REGISTER_TEMPLATE(::boost::fusion::vector, 10)
BOOST_TYPEOF_REGISTER_TYPE(::boost::fusion::void_)
BOOST_TYPEOF_REGISTER_TEMPLATE(::boost::mpl::vector, 20)
BOOST_TYPEOF_REGISTER_TYPE(std::string)
BOOST_TYPEOF_REGISTER_TEMPLATE(::boost::mpl::size_t, (unsigned int))
BOOST_TYPEOF_REGISTER_TYPE(::boost::msm::front::default_base_state)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::detail::inherit_attributes, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::func_state, 6)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::entry_func_state, (int)(typename)(typename)(typename)(typename)(typename)(typename))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::explicit_entry_func_state, (int)(typename)(typename)(typename)(typename)(typename)(typename))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::exit_func_state, 7)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::define_flag, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::attribute, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::define_defer, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::define_init, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Source_, (int))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Target_, (int))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Current_, (int))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Event_, (int))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::State_Attribute_, (typename)(int))
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::State_Machine_, (int))
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::none)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::Row, 5)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::ActionSequence_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::NoAction)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::And_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Or_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Not_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::If_Else_, 3)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::If)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::If_Then_, 2)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::If_Then)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::While_Do_, 2)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::While_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Do_While_, 2)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Do_While_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::For_Loop_, 4)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::For_Loop_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Process_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Process_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Process2_, 2)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Process2_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Get_Flag_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Get_Flag_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Begin_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Begin_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::End_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::End_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Deref_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Deref_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Push_Back_, 2)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Push_Back_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Clear_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Clear_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Empty_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Empty_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Find_, 2)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Find_Helper)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Npos_, 1)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::False_)
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::True_)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Int_, (int))
BOOST_TYPEOF_REGISTER_TYPE(boost::msm::front::euml::Int)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Pre_inc_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Pre_dec_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Post_inc_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Post_dec_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Plus_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Minus_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Multiplies_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Divides_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Modulus_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Bitwise_And_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Bitwise_Or_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Bitwise_Xor_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Subscript_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Plus_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Minus_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Multiplies_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Divides_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Modulus_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::ShiftLeft_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::ShiftRight_Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::ShiftLeft_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::ShiftRight_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Assign_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Unary_Plus_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Unary_Minus_, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Less_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::LessEqual_, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::msm::front::euml::Greater_, 2)
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

View File

@@ -0,0 +1,356 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_GUARD_GRAMMAR_H
#define BOOST_MSM_FRONT_EUML_GUARD_GRAMMAR_H
#include <boost/msm/front/euml/common.hpp>
#include <boost/msm/front/euml/operator.hpp>
#include <boost/msm/front/euml/state_grammar.hpp>
namespace boost { namespace msm { namespace front { namespace euml
{
struct BuildGuards;
struct BuildActions;
struct BuildGuardsCases
{
// The primary template matches nothing:
template<typename Tag>
struct case_
: proto::not_<proto::_>
{};
};
template<>
struct BuildGuardsCases::case_<proto::tag::logical_or>
: 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::logical_and<BuildGuards,BuildGuards >,
And_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::logical_not>
: proto::when<
proto::logical_not<BuildGuards >,
Not_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::less>
: proto::when<
proto::less<BuildGuards, BuildGuards >,
Less_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::less_equal>
: proto::when<
proto::less_equal<BuildGuards, BuildGuards >,
LessEqual_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::greater>
: proto::when<
proto::greater<BuildGuards, BuildGuards >,
Greater_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::greater_equal>
: 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)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::not_equal_to>
: 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::pre_inc<BuildGuards >,
Pre_inc_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::dereference>
: proto::when<
proto::dereference<BuildGuards >,
Deref_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::pre_dec>
: proto::when<
proto::pre_dec<BuildGuards >,
Pre_dec_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::post_inc>
: proto::when<
proto::post_inc<BuildGuards >,
Post_inc_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::post_dec>
: proto::when<
proto::post_dec<BuildGuards >,
Post_dec_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::plus>
: proto::when<
proto::plus<BuildGuards,BuildGuards >,
Plus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::minus>
: proto::when<
proto::minus<BuildGuards,BuildGuards >,
Minus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::multiplies>
: proto::when<
proto::multiplies<BuildGuards,BuildGuards >,
Multiplies_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::divides>
: proto::when<
proto::divides<BuildGuards,BuildGuards >,
Divides_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::modulus>
: proto::when<
proto::modulus<BuildGuards,BuildGuards >,
Modulus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::bitwise_and>
: 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::bitwise_or<BuildGuards,BuildGuards >,
Bitwise_Or_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::subscript>
: proto::when<
proto::subscript<BuildGuards,BuildGuards >,
Subscript_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::plus_assign>
: 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::minus_assign<BuildGuards,BuildGuards >,
Minus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::multiplies_assign>
: 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::divides_assign<BuildGuards,BuildGuards >,
Divides_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::modulus_assign>
: 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::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::shift_right_assign<BuildGuards,BuildGuards >,
ShiftRight_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::shift_left>
: 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::shift_right<BuildGuards,BuildGuards >,
ShiftRight_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::assign>
: proto::when<
proto::assign<BuildGuards,BuildGuards >,
Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::bitwise_xor>
: 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::negate<BuildGuards >,
Unary_Minus_<BuildGuards(proto::_child)>()
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::function>
: 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>) >()
>,
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::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 >,
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>),BuildActions(proto::_child_c<6>) >()
>
#endif
>
{};
template<>
struct BuildGuardsCases::case_<proto::tag::terminal>
: proto::or_<
proto::when <
proto::terminal<action_tag>,
get_action_name<proto::_ >()
>,
proto::when<
proto::terminal<state_tag>,
get_state_name<proto::_>()
>,
proto::when<
proto::terminal<flag_tag>,
proto::_
>,
proto::when<
proto::terminal<event_tag>,
proto::_
>,
proto::when<
proto::terminal<fsm_artefact_tag>,
get_fct<proto::_ >()
>,
proto::when<
proto::terminal<proto::_>,
proto::_value
>
>
{};
struct BuildGuards
: proto::switch_<BuildGuardsCases>
{};
}}}}
#endif //BOOST_MSM_FRONT_EUML_GUARD_GRAMMAR_H

View File

@@ -0,0 +1,26 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_ITERATION_H
#define BOOST_MSM_FRONT_EUML_ITERATION_H
#include <algorithm>
#include <numeric>
#include <boost/msm/front/euml/common.hpp>
namespace boost { namespace msm { namespace front { namespace euml
{
BOOST_MSM_EUML_FUNCTION(ForEach_ , std::for_each , for_each_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(Accumulate_ , std::accumulate , accumulate_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
}}}}
#endif //BOOST_MSM_FRONT_EUML_ITERATION_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
// Copyright 2011 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_PHOENIX_PLACEHOLDERS_H
#define BOOST_MSM_FRONT_EUML_PHOENIX_PLACEHOLDERS_H
#include <boost/phoenix/core/argument.hpp>
// provide some meaningful placeholders (instead of arg1...arg4)
namespace boost { namespace msm { namespace front { namespace euml
{
boost::phoenix::expression::argument<1>::type const _event = {};
boost::phoenix::expression::argument<2>::type const _fsm = {};
boost::phoenix::expression::argument<3>::type const _source = {};
boost::phoenix::expression::argument<4>::type const _target = {};
// this is for state actions
boost::phoenix::expression::argument<3>::type const _state = {};
}}}}
#endif //BOOST_MSM_FRONT_EUML_PHOENIX_PLACEHOLDERS_H

View File

@@ -0,0 +1,43 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_QUERYING_H
#define BOOST_MSM_FRONT_EUML_QUERYING_H
#include <algorithm>
#include <boost/msm/front/euml/common.hpp>
namespace boost { namespace msm { namespace front { namespace euml
{
BOOST_MSM_EUML_FUNCTION(Find_ , std::find , find_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(FindIf_ , std::find_if , find_if_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(LowerBound_ , std::lower_bound , lower_bound_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(UpperBound_ , std::upper_bound , upper_bound_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(BinarySearch_ , std::binary_search , binary_search_ , bool , bool )
BOOST_MSM_EUML_FUNCTION(MinElement_ , std::min_element , min_element_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(MaxElement_ , std::max_element , max_element_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(AdjacentFind_ , std::adjacent_find , adjacent_find_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(FindEnd_ , std::find_end , find_end_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(FindFirstOf_ , std::find_first_of , find_first_of_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(Equal_ , std::equal , equal_ , bool , bool )
BOOST_MSM_EUML_FUNCTION(Search_ , std::search , search_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(Includes_ , std::includes , includes_ , bool , bool )
BOOST_MSM_EUML_FUNCTION(LexicographicalCompare_ , std::lexicographical_compare , lexicographical_compare_ , bool , bool )
BOOST_MSM_EUML_FUNCTION(Count_ , std::count , count_ , RESULT_TYPE_DIFF_TYPE_ITER_TRAITS_PARAM1 , RESULT_TYPE2_DIFF_TYPE_ITER_TRAITS_PARAM1 )
BOOST_MSM_EUML_FUNCTION(CountIf_ , std::count_if , count_if_ , RESULT_TYPE_DIFF_TYPE_ITER_TRAITS_PARAM1 , RESULT_TYPE2_DIFF_TYPE_ITER_TRAITS_PARAM1 )
BOOST_MSM_EUML_FUNCTION(Distance_ , std::distance , distance_ , RESULT_TYPE_DIFF_TYPE_ITER_TRAITS_PARAM1 , RESULT_TYPE2_DIFF_TYPE_ITER_TRAITS_PARAM1 )
BOOST_MSM_EUML_FUNCTION(EqualRange_ , std::equal_range , equal_range_ , RESULT_TYPE_PAIR_REMOVE_REF_PARAM1 , RESULT_TYPE2_PAIR_REMOVE_REF_PARAM1 )
BOOST_MSM_EUML_FUNCTION(Mismatch_ , std::mismatch , mismatch_ , RESULT_TYPE_PAIR_REMOVE_REF_PARAM1 , RESULT_TYPE2_PAIR_REMOVE_REF_PARAM1 )
}}}}
#endif //BOOST_MSM_FRONT_EUML_QUERYING_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_STL_H
#define BOOST_MSM_FRONT_EUML_STL_H
#include <boost/msm/front/euml/container.hpp>
#include <boost/msm/front/euml/algorithm.hpp>
#endif //BOOST_MSM_FRONT_EUML_STL_H

View File

@@ -0,0 +1,280 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_STT_GRAMMAR_H
#define BOOST_MSM_FRONT_EUML_STT_GRAMMAR_H
#include <boost/msm/front/euml/common.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/msm/front/euml/operator.hpp>
#include <boost/msm/front/euml/guard_grammar.hpp>
#include <boost/msm/front/euml/state_grammar.hpp>
namespace proto = boost::proto;
namespace boost { namespace msm { namespace front { namespace euml
{
template <class SOURCE,class EVENT,class TARGET,class ACTION=none,class GUARD=none>
struct TempRow
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef TARGET Target;
typedef ACTION Action;
typedef GUARD Guard;
};
template <class TEMP_ROW>
struct convert_to_row
{
typedef Row<typename TEMP_ROW::Source,typename TEMP_ROW::Evt,typename TEMP_ROW::Target,
typename TEMP_ROW::Action,typename TEMP_ROW::Guard> type;
};
template <class TEMP_ROW>
struct convert_to_internal_row
{
typedef Internal<typename TEMP_ROW::Evt,
typename TEMP_ROW::Action,typename TEMP_ROW::Guard> type;
};
// explicit + fork + entry point + exit point grammar
struct BuildEntry
: proto::or_<
proto::when<
proto::function<proto::terminal<proto::_>,proto::terminal<state_tag>,proto::terminal<state_tag> >,
get_fct<proto::_child_c<0>,get_state_name<proto::_child_c<1>() >(),get_state_name<proto::_child_c<2>() >() >()
>
>
{};
// row grammar
struct BuildNextStates
: proto::or_<
proto::when<
proto::terminal<state_tag>,
get_state_name<proto::_>()
>,
proto::when<
BuildEntry,
BuildEntry
>,
proto::when<
proto::comma<BuildEntry,BuildEntry >,
::boost::mpl::push_back<
make_vector_one_row<BuildEntry(proto::_left)>(),
BuildEntry(proto::_right)>()
>,
proto::when <
proto::comma<BuildNextStates,BuildEntry >,
::boost::mpl::push_back<
BuildNextStates(proto::_left),
BuildEntry(proto::_right) >()
>
>
{};
template <class EventGuard,class ActionClass>
struct fusion_event_action_guard
{
typedef TempRow<none,typename EventGuard::Evt,none,typename ActionClass::Action,typename EventGuard::Guard> type;
};
template <class SourceGuard,class ActionClass>
struct fusion_source_action_guard
{
typedef TempRow<typename SourceGuard::Source,none,none,typename ActionClass::Action,typename SourceGuard::Guard> type;
};
template <class SourceClass,class EventClass>
struct fusion_source_event_action_guard
{
typedef TempRow<typename SourceClass::Source,typename EventClass::Evt,
none,typename EventClass::Action,typename EventClass::Guard> type;
};
template <class Left,class Right>
struct fusion_left_right
{
typedef TempRow<typename Right::Source,typename Right::Evt,typename Left::Target
,typename Right::Action,typename Right::Guard> type;
};
struct BuildEventPlusGuard
: proto::or_<
proto::when<
proto::subscript<proto::terminal<event_tag>, GuardGrammar >,
TempRow<none,proto::_left,none,none, GuardGrammar(proto::_right)>(proto::_right)
>
>
{};
struct BuildSourceState
: proto::or_<
proto::when<
proto::terminal<state_tag>,
get_state_name<proto::_>()
>,
proto::when<
BuildEntry,
BuildEntry
>
>
{};
struct BuildSourcePlusGuard
: proto::when<
proto::subscript<BuildSourceState,GuardGrammar >,
TempRow<BuildSourceState(proto::_left),none,none,none,GuardGrammar(proto::_right)>(proto::_right)
>
{};
struct BuildEvent
: proto::or_<
// just event without guard/action
proto::when<
proto::terminal<event_tag>,
TempRow<none,proto::_,none>() >
// event / action
, proto::when<
proto::divides<proto::terminal<event_tag>,ActionGrammar >,
TempRow<none,proto::_left,none,ActionGrammar(proto::_right) >(proto::_right) >
// event [ guard ]
, proto::when<
proto::subscript<proto::terminal<event_tag>,GuardGrammar >,
TempRow<none,proto::_left,none,none,GuardGrammar(proto::_right)>(proto::_right) >
// event [ guard ] / action
, proto::when<
proto::divides<BuildEventPlusGuard, ActionGrammar>,
fusion_event_action_guard<BuildEventPlusGuard(proto::_left),
TempRow<none,none,none,ActionGrammar(proto::_right)>(proto::_right)
>()
>
>
{};
struct BuildSource
: proto::or_<
// after == if just state without event or guard/action
proto::when<
BuildSourceState,
TempRow<BuildSourceState(proto::_),none,none>() >
// == source / action
, proto::when<
proto::divides<BuildSourceState,ActionGrammar >,
TempRow<BuildSourceState(proto::_left),none,none,ActionGrammar(proto::_right) >(proto::_right) >
// == source [ guard ]
, proto::when<
proto::subscript<BuildSourceState,GuardGrammar >,
TempRow<BuildSourceState(proto::_left),none,none,none,GuardGrammar(proto::_right)>(proto::_right) >
// == source [ guard ] / action
, proto::when<
proto::divides<BuildSourcePlusGuard,
ActionGrammar >,
fusion_source_action_guard<BuildSourcePlusGuard(proto::_left),
TempRow<none,none,none,ActionGrammar(proto::_right)>(proto::_right)
>()
>
>
{};
struct BuildRight
: proto::or_<
proto::when<
proto::plus<BuildSource,BuildEvent >,
fusion_source_event_action_guard<BuildSource(proto::_left),BuildEvent(proto::_right)>()
>,
proto::when<
BuildSource,
BuildSource
>
>
{};
struct BuildRow
: proto::or_<
// grammar 1
proto::when<
proto::equal_to<BuildNextStates,BuildRight >,
convert_to_row<
fusion_left_right<TempRow<none,none,BuildNextStates(proto::_left)>,BuildRight(proto::_right)> >()
>,
// internal events
proto::when<
BuildRight,
convert_to_row<
fusion_left_right<TempRow<none,none,none>,BuildRight(proto::_)> >()
>,
// grammar 2
proto::when<
proto::equal_to<BuildRight,BuildNextStates>,
convert_to_row<
fusion_left_right<TempRow<none,none,BuildNextStates(proto::_right)>,BuildRight(proto::_left)> >()
>
>
{};
// stt grammar
struct BuildStt
: proto::or_<
proto::when<
proto::comma<BuildStt,BuildStt>,
boost::mpl::push_back<BuildStt(proto::_left),BuildRow(proto::_right)>()
>,
proto::when <
BuildRow,
make_vector_one_row<BuildRow(proto::_)>()
>
>
{};
template <class Expr>
typename ::boost::mpl::eval_if<
typename proto::matches<Expr,BuildStt>::type,
boost::result_of<BuildStt(Expr)>,
make_invalid_type>::type
build_stt(Expr const& expr)
{
return typename boost::result_of<BuildStt(Expr)>::type();
}
// internal stt grammar
struct BuildInternalRow
: proto::when<
BuildEvent,
convert_to_internal_row<
fusion_left_right<TempRow<none,none,none>,BuildEvent(proto::_)> >()
>
{};
struct BuildInternalStt
: proto::or_<
proto::when<
proto::comma<BuildInternalStt,BuildInternalStt>,
boost::mpl::push_back<BuildInternalStt(proto::_left),BuildInternalRow(proto::_right)>()
>,
proto::when <
BuildInternalRow,
make_vector_one_row<BuildInternalRow(proto::_)>()
>
>
{};
template <class Expr>
typename ::boost::mpl::eval_if<
typename proto::matches<Expr,BuildInternalStt>::type,
boost::result_of<BuildInternalStt(Expr)>,
make_invalid_type>::type
build_internal_stt(Expr const& expr)
{
return typename boost::result_of<BuildInternalStt(Expr)>::type();
}
}}}}
#endif //BOOST_MSM_FRONT_EUML_STT_GRAMMAR_H

View File

@@ -0,0 +1,335 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_EUML_TRANSFORMATION_H
#define BOOST_MSM_FRONT_EUML_TRANSFORMATION_H
#include <algorithm>
#include <boost/msm/front/euml/common.hpp>
namespace boost { namespace msm { namespace front { namespace euml
{
#ifdef __STL_CONFIG_H
BOOST_MSM_EUML_FUNCTION(FillN_ , std::fill_n , fill_n_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(Rotate_ , std::rotate , rotate_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(GenerateN_ , std::generate_n , generate_n_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
#else
BOOST_MSM_EUML_FUNCTION(FillN_ , std::fill_n , fill_n_ , void , void )
BOOST_MSM_EUML_FUNCTION(Rotate_ , std::rotate , rotate_ , void , void )
BOOST_MSM_EUML_FUNCTION(GenerateN_ , std::generate_n , generate_n_ , void , void )
#endif
BOOST_MSM_EUML_FUNCTION(Copy_ , std::copy , copy_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(CopyBackward_ , std::copy_backward , copy_backward_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(Reverse_ , std::reverse , reverse_ , void , void )
BOOST_MSM_EUML_FUNCTION(ReverseCopy_ , std::reverse_copy , reverse_copy_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(Remove_ , std::remove , remove_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(RemoveIf_ , std::remove_if , remove_if_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(RemoveCopy_ , std::remove_copy , remove_copy_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(RemoveCopyIf_ , std::remove_copy_if , remove_copy_if_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(Fill_ , std::fill , fill_ , void , void )
BOOST_MSM_EUML_FUNCTION(Generate_ , std::generate , generate_ , void , void )
BOOST_MSM_EUML_FUNCTION(Unique_ , std::unique , unique_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(UniqueCopy_ , std::unique_copy , unique_copy_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(RandomShuffle_ , std::random_shuffle , random_shuffle_ , void , void )
BOOST_MSM_EUML_FUNCTION(RotateCopy_ , std::rotate_copy , rotate_copy_ , RESULT_TYPE_PARAM4 , RESULT_TYPE2_PARAM4 )
BOOST_MSM_EUML_FUNCTION(Partition_ , std::partition , partition_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(StablePartition_ , std::stable_partition , stable_partition_ , RESULT_TYPE_PARAM1 , RESULT_TYPE2_PARAM1 )
BOOST_MSM_EUML_FUNCTION(Sort_ , std::sort , sort_ , void , void )
BOOST_MSM_EUML_FUNCTION(StableSort_ , std::stable_sort , stable_sort_ , void , void )
BOOST_MSM_EUML_FUNCTION(PartialSort_ , std::partial_sort , partial_sort_ , void , void )
BOOST_MSM_EUML_FUNCTION(PartialSortCopy_ , std::partial_sort_copy , partial_sort_copy_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(NthElement_ , std::nth_element , nth_element_ , void , void )
BOOST_MSM_EUML_FUNCTION(Merge_ , std::merge , merge_ , RESULT_TYPE_PARAM5 , RESULT_TYPE2_PARAM5 )
BOOST_MSM_EUML_FUNCTION(InplaceMerge_ , std::inplace_merge , inplace_merge_ , void , void )
BOOST_MSM_EUML_FUNCTION(SetUnion_ , std::set_union , set_union_ , RESULT_TYPE_PARAM5 , RESULT_TYPE2_PARAM5 )
BOOST_MSM_EUML_FUNCTION(PushHeap_ , std::push_heap , push_heap_ , void , void )
BOOST_MSM_EUML_FUNCTION(PopHeap_ , std::pop_heap , pop_heap_ , void , void )
BOOST_MSM_EUML_FUNCTION(MakeHeap_ , std::make_heap , make_heap_ , void , void )
BOOST_MSM_EUML_FUNCTION(SortHeap_ , std::sort_heap , sort_heap_ , void , void )
BOOST_MSM_EUML_FUNCTION(NextPermutation_ , std::next_permutation , next_permutation_ , bool , bool )
BOOST_MSM_EUML_FUNCTION(PrevPermutation_ , std::prev_permutation , prev_permutation_ , bool , bool )
BOOST_MSM_EUML_FUNCTION(InnerProduct_ , std::inner_product , inner_product_ , RESULT_TYPE_PARAM4 , RESULT_TYPE2_PARAM4 )
BOOST_MSM_EUML_FUNCTION(PartialSum_ , std::partial_sum , partial_sum_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(AdjacentDifference_ , std::adjacent_difference , adjacent_difference_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(Replace_ , std::replace , replace_ , void , void )
BOOST_MSM_EUML_FUNCTION(ReplaceIf_ , std::replace_if , replace_if_ , void , void )
BOOST_MSM_EUML_FUNCTION(ReplaceCopy_ , std::replace_copy , replace_copy_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
BOOST_MSM_EUML_FUNCTION(ReplaceCopyIf_ , std::replace_copy_if , replace_copy_if_ , RESULT_TYPE_PARAM3 , RESULT_TYPE2_PARAM3 )
template <class T>
struct BackInserter_ : euml_action<BackInserter_<T> >
{
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef std::back_insert_iterator<
typename ::boost::remove_reference<
typename get_result_type2<T,Event,FSM,STATE>::type>::type> type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef std::back_insert_iterator<
typename ::boost::remove_reference<
typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type> type;
};
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
{
return std::back_inserter(T()(evt,fsm,state));
}
};
struct back_inserter_tag {};
struct BackInserter_Helper: proto::extends< proto::terminal<back_inserter_tag>::type, BackInserter_Helper, sm_domain>
{
BackInserter_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
#endif
>
struct In
{
typedef BackInserter_<Arg1> type;
};
};
BackInserter_Helper const back_inserter_;
template <class T>
struct FrontInserter_ : euml_action<FrontInserter_<T> >
{
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef std::front_insert_iterator<
typename ::boost::remove_reference<
typename get_result_type2<T,Event,FSM,STATE>::type>::type> type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef std::front_insert_iterator<
typename ::boost::remove_reference<
typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type> type;
};
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
{
return std::front_inserter(T()(evt,fsm,state));
}
};
struct front_inserter_tag {};
struct FrontInserter_Helper: proto::extends< proto::terminal<front_inserter_tag>::type, FrontInserter_Helper, sm_domain>
{
FrontInserter_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
#endif
>
struct In
{
typedef FrontInserter_<Arg1> type;
};
};
FrontInserter_Helper const front_inserter_;
template <class T,class Pos>
struct Inserter_ : euml_action<Inserter_<T,Pos> >
{
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef std::insert_iterator<
typename ::boost::remove_reference<
typename get_result_type2<T,Event,FSM,STATE>::type>::type> type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef std::insert_iterator<
typename ::boost::remove_reference<
typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type> type;
};
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
{
return std::inserter(T()(evt,fsm,state),Pos()(evt,fsm,state));
}
};
struct inserter_tag {};
struct Inserter_Helper: proto::extends< proto::terminal<inserter_tag>::type, Inserter_Helper, sm_domain>
{
Inserter_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
#endif
>
struct In
{
typedef Inserter_<Arg1,Arg2> type;
};
};
Inserter_Helper const inserter_;
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Enable=void >
struct Transform_ : euml_action<Transform_<Param1,Param2,Param3,Param4,Param5,Enable> >
{
};
template <class Param1, class Param2, class Param3, class Param4, class Param5>
struct Transform_<Param1,Param2,Param3,Param4,Param5,
typename ::boost::enable_if<typename ::boost::is_same<Param5,void>::type >::type>
: euml_action<Transform_<Param1,Param2,Param3,Param4,Param5> >
{
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename get_result_type2<Param3,Event,FSM,STATE>::type type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename get_result_type<Param3,EVT,FSM,SourceState,TargetState>::type type;
};
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
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
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::transform(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state),
Param4()(evt,fsm,state));
}
};
template <class Param1, class Param2, class Param3, class Param4, class Param5>
struct Transform_<Param1,Param2,Param3,Param4,Param5,
typename ::boost::disable_if<typename ::boost::is_same<Param5,void>::type >::type>
: euml_action<Transform_<Param1,Param2,Param3,Param4,Param5> >
{
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef typename get_result_type2<Param4,Event,FSM,STATE>::type type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef typename get_result_type<Param4,EVT,FSM,SourceState,TargetState>::type type;
};
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
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
operator()(Event const& evt,FSM& fsm,STATE& state )const
{
return std::transform (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state),
Param4()(evt,fsm,state),Param5()(evt,fsm,state));
}
};
struct transform_tag {};
struct Transform_Helper: proto::extends< proto::terminal<transform_tag>::type, Transform_Helper, sm_domain>
{
Transform_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
#endif
>
struct In
{
typedef Transform_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
};
};
Transform_Helper const transform_;
}}}}
#endif //BOOST_MSM_FRONT_EUML_TRANSFORMATION_H

View File

@@ -0,0 +1,338 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_FUNCTOR_ROW_H
#define BOOST_MSM_FRONT_FUNCTOR_ROW_H
#include <boost/mpl/set.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/msm/back/common_types.hpp>
#include <boost/msm/row_tags.hpp>
#include <boost/msm/common.hpp>
#include <boost/msm/front/completion_event.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_MPL_HAS_XXX_TRAIT_DEF(deferring_action)
namespace boost { namespace msm { namespace front
{
template <class Func,class Enable=void>
struct get_functor_return_value
{
static const ::boost::msm::back::HandledEnum value = ::boost::msm::back::HANDLED_TRUE;
};
template <class Func>
struct get_functor_return_value<Func,
typename ::boost::enable_if<
typename has_deferring_action<Func>::type
>::type
>
{
static const ::boost::msm::back::HandledEnum value = ::boost::msm::back::HANDLED_DEFERRED;
};
template <class SOURCE,class EVENT,class TARGET,class ACTION=none,class GUARD=none>
struct Row
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef TARGET Target;
typedef ACTION Action;
typedef GUARD Guard;
// action plus guard
typedef row_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
Action()(evt,fsm,src,tgt);
return get_functor_return_value<Action>::value;
}
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt,AllStates&)
{
// create functor, call it
return Guard()(evt,fsm,src,tgt);
}
};
template<class SOURCE,class EVENT,class TARGET>
struct Row<SOURCE,EVENT,TARGET,none,none>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef TARGET Target;
typedef none Action;
typedef none Guard;
// no action, no guard
typedef _row_tag row_type_tag;
};
template<class SOURCE,class EVENT,class TARGET,class ACTION>
struct Row<SOURCE,EVENT,TARGET,ACTION,none>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef TARGET Target;
typedef ACTION Action;
typedef none Guard;
// no guard
typedef a_row_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
Action()(evt,fsm,src,tgt);
return get_functor_return_value<Action>::value;
}
};
template<class SOURCE,class EVENT,class TARGET,class GUARD>
struct Row<SOURCE,EVENT,TARGET,none,GUARD>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef TARGET Target;
typedef none Action;
typedef GUARD Guard;
// no action
typedef g_row_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
return Guard()(evt,fsm,src,tgt);
}
};
// internal transitions
template<class SOURCE,class EVENT,class ACTION>
struct Row<SOURCE,EVENT,none,ACTION,none>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef Source Target;
typedef ACTION Action;
typedef none Guard;
// no guard
typedef a_irow_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
Action()(evt,fsm,src,tgt);
return get_functor_return_value<Action>::value;
}
};
template<class SOURCE,class EVENT,class GUARD>
struct Row<SOURCE,EVENT,none,none,GUARD>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef Source Target;
typedef none Action;
typedef GUARD Guard;
// no action
typedef g_irow_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
return Guard()(evt,fsm,src,tgt);
}
};
template<class SOURCE,class EVENT,class ACTION,class GUARD>
struct Row<SOURCE,EVENT,none,ACTION,GUARD>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef Source Target;
typedef ACTION Action;
typedef GUARD Guard;
// action + guard
typedef irow_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
Action()(evt,fsm,src,tgt);
return get_functor_return_value<Action>::value;
}
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
return Guard()(evt,fsm,src,tgt);
}
};
template<class SOURCE,class EVENT>
struct Row<SOURCE,EVENT,none,none,none>
{
typedef SOURCE Source;
typedef EVENT Evt;
typedef Source Target;
typedef none Action;
typedef none Guard;
// no action, no guard
typedef _irow_tag row_type_tag;
};
template<class TGT>
struct get_row_target
{
typedef typename TGT::Target type;
};
template <class EVENT,class ACTION=none,class GUARD=none>
struct Internal
{
typedef EVENT Evt;
typedef ACTION Action;
typedef GUARD Guard;
// action plus guard
typedef sm_i_row_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
Action()(evt,fsm,src,tgt);
return get_functor_return_value<Action>::value;
}
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
return Guard()(evt,fsm,src,tgt);
}
};
template<class EVENT,class ACTION>
struct Internal<EVENT,ACTION,none>
{
typedef EVENT Evt;
typedef ACTION Action;
typedef none Guard;
// no guard
typedef sm_a_i_row_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
Action()(evt,fsm,src,tgt);
return get_functor_return_value<Action>::value;
}
};
template<class EVENT,class GUARD>
struct Internal<EVENT,none,GUARD>
{
typedef EVENT Evt;
typedef none Action;
typedef GUARD Guard;
// no action
typedef sm_g_i_row_tag row_type_tag;
template <class EVT,class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,EVT const& evt,SourceState& src,TargetState& tgt, AllStates&)
{
// create functor, call it
return Guard()(evt,fsm,src,tgt);
}
};
template<class EVENT>
struct Internal<EVENT,none,none>
{
typedef EVENT Evt;
typedef none Action;
typedef none Guard;
// no action, no guard
typedef sm__i_row_tag row_type_tag;
};
struct event_tag{};
struct action_tag{};
struct state_action_tag{};
struct flag_tag{};
struct config_tag{};
struct not_euml_tag{};
template <class Sequence>
struct ActionSequence_
{
typedef Sequence sequence;
template <class Event,class FSM,class STATE >
struct state_action_result
{
typedef void type;
};
template <class EVT,class FSM,class STATE>
struct Call
{
Call(EVT const& evt,FSM& fsm,STATE& state):
evt_(evt),fsm_(fsm),state_(state){}
template <class FCT>
void operator()(::boost::msm::wrap<FCT> const& )
{
FCT()(evt_,fsm_,state_);
}
private:
EVT const& evt_;
FSM& fsm_;
STATE& state_;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct transition_action_result
{
typedef void type;
};
template <class EVT,class FSM,class SourceState,class TargetState>
struct Call2
{
Call2(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt):
evt_(evt),fsm_(fsm),src_(src),tgt_(tgt){}
template <class FCT>
void operator()(::boost::msm::wrap<FCT> const& )
{
FCT()(evt_,fsm_,src_,tgt_);
}
private:
EVT const & evt_;
FSM& fsm_;
SourceState& src_;
TargetState& tgt_;
};
typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
template <class EVT,class FSM,class STATE>
void operator()(EVT const& evt,FSM& fsm,STATE& state)
{
mpl::for_each<Sequence,boost::msm::wrap< ::boost::mpl::placeholders::_1> >
(Call<EVT,FSM,STATE>(evt,fsm,state));
}
template <class EVT,class FSM,class SourceState,class TargetState>
void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)
{
mpl::for_each<Sequence,boost::msm::wrap< ::boost::mpl::placeholders::_1> >
(Call2<EVT,FSM,SourceState,TargetState>(evt,fsm,src,tgt));
}
};
// functor pre-defined for basic functionality
struct Defer
{
// mark as deferring to avoid stack overflows in certain conditions
typedef int deferring_action;
template <class EVT,class FSM,class SourceState,class TargetState>
void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& ) const
{
fsm.defer_event(evt);
}
};
}}}
#endif //BOOST_MSM_FRONT_FUNCTOR_ROW_H

View File

@@ -0,0 +1,105 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_INTERNAL_ROW_HPP
#define BOOST_MSM_INTERNAL_ROW_HPP
#include <boost/type_traits/is_base_of.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/fusion/include/at_key.hpp>
#include <boost/msm/back/common_types.hpp>
#include <boost/msm/row_tags.hpp>
#include <boost/msm/front/detail/row2_helper.hpp>
namespace boost { namespace msm { namespace front
{
template<
class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
>
struct a_internal
{
typedef sm_a_i_row_tag row_type_tag;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
{
// in this front-end, we don't need to know source and target states
::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
return ::boost::msm::back::HANDLED_TRUE;
}
};
template<
class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct internal
{
typedef sm_i_row_tag row_type_tag;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
{
// in this front-end, we don't need to know source and target states
::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
return ::boost::msm::back::HANDLED_TRUE;
}
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)
{
// in this front-end, we don't need to know source and target states
return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
class Event
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct g_internal
{
typedef sm_g_i_row_tag row_type_tag;
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)
{
// in this front-end, we don't need to know source and target states
return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
class Event
>
struct _internal
{
typedef sm__i_row_tag row_type_tag;
typedef Event Evt;
};
}}}
#endif //BOOST_MSM_INTERNAL_ROW_HPP

204
test/external/boost/msm/front/row2.hpp vendored Normal file
View File

@@ -0,0 +1,204 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_ROW2_HPP
#define BOOST_MSM_ROW2_HPP
#include <boost/type_traits/is_base_of.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/fusion/include/at_key.hpp>
#include <boost/msm/back/common_types.hpp>
#include <boost/msm/row_tags.hpp>
#include <boost/msm/front/detail/row2_helper.hpp>
namespace boost { namespace msm { namespace front
{
template<
typename T1
, class Event
, typename T2
>
struct _row2
{
typedef _row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
};
template<
typename T1
, class Event
, typename T2
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
>
struct a_row2
{
typedef a_row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
{
// in this front-end, we don't need to know source and target states
::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::template call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
return ::boost::msm::back::HANDLED_TRUE;
}
};
template<
typename T1
, class Event
, typename T2
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct row2
{
typedef row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState, class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
{
// in this front-end, we don't need to know source and target states
::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
return ::boost::msm::back::HANDLED_TRUE;
}
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)
{
// in this front-end, we don't need to know source and target states
return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
typename T1
, class Event
, typename T2
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct g_row2
{
typedef g_row_tag row_type_tag;
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)
{
// in this front-end, we don't need to know source and target states
return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
// internal transitions
template<
typename T1
, class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
>
struct a_irow2
{
typedef a_irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
{
// in this front-end, we don't need to know source and target states
::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
return ::boost::msm::back::HANDLED_TRUE;
}
};
template<
typename T1
, class Event
, typename CalledForAction
, void (CalledForAction::*action)(Event const&)
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct irow2
{
typedef irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum action_call(FSM& fsm,Event const& evt,SourceState& src,TargetState& tgt,
AllStates& all_states)
{
// in this front-end, we don't need to know source and target states
::boost::msm::front::detail::row2_action_helper<CalledForAction,Event,action>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForAction,FSM>::type::value>());
return ::boost::msm::back::HANDLED_TRUE;
}
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)
{
// in this front-end, we don't need to know source and target states
return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
template<
typename T1
, class Event
, typename CalledForGuard
, bool (CalledForGuard::*guard)(Event const&)
>
struct g_irow2
{
typedef g_irow_tag row_type_tag;
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)
{
// in this front-end, we don't need to know source and target states
return ::boost::msm::front::detail::row2_guard_helper<CalledForGuard,Event,guard>::call_helper
(fsm,evt,src,tgt,all_states,
::boost::mpl::bool_< ::boost::is_base_of<CalledForGuard,FSM>::type::value>());
}
};
}}}
#endif //BOOST_MSM_ROW2_HPP

View File

@@ -0,0 +1,215 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_STATEMACHINE_DEF_H
#define BOOST_MSM_FRONT_STATEMACHINE_DEF_H
#include <exception>
#include <boost/assert.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/msm/row_tags.hpp>
#include <boost/msm/back/common_types.hpp>
#include <boost/msm/front/states.hpp>
#include <boost/msm/front/completion_event.hpp>
#include <boost/msm/front/common_states.hpp>
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;
// customization (message queue, exceptions)
typedef ::boost::mpl::vector0<> configuration;
typedef BaseState BaseAllStates;
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;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum 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);
return ::boost::msm::back::HANDLED_TRUE;
}
};
template<
typename T1
, class Event
, typename T2
>
struct _row
{
typedef _row_tag row_type_tag;
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
{
typedef row_tag row_type_tag;
typedef T1 Source;
typedef T2 Target;
typedef Event Evt;
template <class FSM,class SourceState,class TargetState, class AllStates>
static ::boost::msm::back::HandledEnum 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);
return ::boost::msm::back::HANDLED_TRUE;
}
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
// 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
{
typedef g_row_tag row_type_tag;
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&)
{
// in this front-end, we don't need to know source and target states
return (fsm.*guard)(evt);
}
};
// internal transitions
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;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum 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);
return ::boost::msm::back::HANDLED_TRUE;
}
};
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;
template <class FSM,class SourceState,class TargetState,class AllStates>
static ::boost::msm::back::HandledEnum 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);
return ::boost::msm::back::HANDLED_TRUE;
}
template <class FSM,class SourceState,class TargetState,class AllStates>
static bool guard_call(FSM& fsm,Event const& evt,SourceState&,TargetState&,AllStates&)
{
// 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
{
typedef g_irow_tag row_type_tag;
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&)
{
// in this front-end, we don't need to know source and target states
return (fsm.*guard)(evt);
}
};
// internal row withou action or guard. Does nothing except forcing the event to be ignored.
template<
typename T1
, class Event
>
struct _irow
{
typedef _irow_tag row_type_tag;
typedef T1 Source;
typedef T1 Target;
typedef Event Evt;
};
protected:
// Default no-transition handler. Can be replaced in the Derived SM class.
template <class FSM,class Event>
void no_transition(Event const& ,FSM&, int state)
{
BOOST_ASSERT(false);
}
// default exception handler. Can be replaced in the Derived SM class.
template <class FSM,class Event>
void exception_caught (Event const&,FSM&,std::exception& )
{
BOOST_ASSERT(false);
}
};
} } }// boost::msm::front
#endif //BOOST_MSM_FRONT_STATEMACHINE_DEF_H

128
test/external/boost/msm/front/states.hpp vendored Normal file
View File

@@ -0,0 +1,128 @@
// Copyright 2008 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Copyright for the original version:
// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
// under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MSM_FRONT_STATES_H
#define BOOST_MSM_FRONT_STATES_H
#include <boost/mpl/bool.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/msm/front/common_states.hpp>
#include <boost/msm/row_tags.hpp>
namespace boost { namespace msm { namespace front
{
struct no_sm_ptr
{
// tags
typedef ::boost::mpl::bool_<false> needs_sm;
};
struct sm_ptr
{
// tags
typedef ::boost::mpl::bool_<true> needs_sm;
};
// kept for backward compatibility
struct NoSMPtr
{
// tags
typedef ::boost::mpl::bool_<false> needs_sm;
};
struct SMPtr
{
// tags
typedef ::boost::mpl::bool_<true> needs_sm;
};
// provides the typedefs and interface. Concrete states derive from it.
// template argument: pointer-to-fsm policy
template<class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
struct state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
{
// tags
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
// terminate state simply defines the TerminateFlag flag
// template argument: pointer-to-fsm policy
template<class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
struct terminate_state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
{
// tags
typedef ::boost::mpl::vector<boost::msm::TerminateFlag> flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
// terminate state simply defines the InterruptedFlag and EndInterruptFlag<EndInterruptEvent> flags
// template argument: event which ends the interrupt
// template argument: pointer-to-fsm policy
template <class EndInterruptEvent,class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
struct interrupt_state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
{
// tags
typedef ::boost::mpl::vector<boost::msm::InterruptedFlag,
boost::msm::EndInterruptFlag<EndInterruptEvent> >
flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
// not a state but a bunch of extra typedefs to handle direct entry into a composite state. To be derived from
// template argument: zone index of this state
template <int ZoneIndex=-1>
struct explicit_entry
{
typedef int explicit_entry_state;
enum {zone_index=ZoneIndex};
};
// to be derived from. Makes a type an entry (pseudo) state. Actually an almost full-fledged state
// template argument: containing composite
// template argument: zone index of this state
// template argument: pointer-to-fsm policy
template<int ZoneIndex=-1,class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
struct entry_pseudo_state
: public boost::msm::front::detail::state_base<BASE>,SMPtrPolicy
{
// tags
typedef int pseudo_entry;
enum {zone_index=ZoneIndex};
typedef int explicit_entry_state;
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
// to be derived from. Makes a state an exit (pseudo) state. Actually an almost full-fledged state
// template argument: event to forward
// template argument: pointer-to-fsm policy
template<class Event,class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
struct exit_pseudo_state : public boost::msm::front::detail::state_base<BASE> , SMPtrPolicy
{
typedef Event event;
typedef BASE Base;
typedef SMPtrPolicy PtrPolicy;
typedef int pseudo_exit;
// default: no flag
typedef ::boost::mpl::vector< > flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
}}}
#endif //BOOST_MSM_FRONT_STATES_H