Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-26 08:40:59

0001 // Copyright 2008 Christophe Henry
0002 // henry UNDERSCORE christophe AT hotmail DOT com
0003 // This is an extended version of the state machine available in the boost::mpl library
0004 // Distributed under the same license as the original.
0005 // Copyright for the original version:
0006 // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
0007 // under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_MSM_FRONT_OPERATOR_H
0012 #define BOOST_MSM_FRONT_OPERATOR_H
0013 
0014 
0015 
0016 namespace boost { namespace msm { namespace front
0017 {
0018 
0019 template <class T1,class T2>
0020 struct Or_
0021 {
0022     template <class EVT,class FSM,class SourceState,class TargetState>
0023     bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
0024     {
0025         return (T1()(evt,fsm,src,tgt) || T2()(evt,fsm,src,tgt));
0026     }
0027     template <class Event,class FSM,class STATE>
0028     bool operator()(Event const& evt,FSM& fsm,STATE& state)
0029     {
0030         return (T1()(evt,fsm,state) || T2()(evt,fsm,state));
0031     }
0032 };
0033 template <class T1,class T2>
0034 struct And_
0035 {
0036     template <class EVT,class FSM,class SourceState,class TargetState>
0037     bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
0038     {
0039         return (T1()(evt,fsm,src,tgt) && T2()(evt,fsm,src,tgt));
0040     }
0041     template <class Event,class FSM,class STATE>
0042     bool operator()(Event const& evt,FSM& fsm,STATE& state)
0043     {
0044         return (T1()(evt,fsm,state) && T2()(evt,fsm,state));
0045     }
0046 };
0047 template <class T1>
0048 struct Not_
0049 {
0050     template <class EVT,class FSM,class SourceState,class TargetState>
0051     bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
0052     {
0053         return !(T1()(evt,fsm,src,tgt));
0054     }
0055     template <class Event,class FSM,class STATE>
0056     bool operator()(Event const& evt,FSM& fsm,STATE& state)
0057     {
0058         return !(T1()(evt,fsm,state));
0059     }
0060 };
0061 
0062 
0063 }}}
0064 
0065 #endif // BOOST_MSM_FRONT_OPERATOR_H