1 // Copyright 2008 Christophe Henry
2 // henry UNDERSCORE christophe AT hotmail DOT com
3 // This is an extended version of the state machine available in the boost::mpl library
4 // Distributed under the same license as the original.
5 // Copyright for the original version:
6 // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
7 // under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_MSM_ACTIVE_STATE_SWITCHING_POLICIES_H
12 #define BOOST_MSM_ACTIVE_STATE_SWITCHING_POLICIES_H
14 namespace boost { namespace msm
18 // Default: new active state set after the transition (after entry)
19 struct active_state_switch_after_entry
21 static int after_guard(int current_state,int){return current_state;}
22 static int after_exit(int current_state,int){return current_state;}
23 static int after_action(int current_state,int){return current_state;}
24 static int after_entry(int,int next_state){return next_state;}
27 // new state set before the transition starts
28 struct active_state_switch_before_transition
30 static int after_guard(int,int next_state){return next_state;}
31 static int after_exit(int,int next_state){return next_state;}
32 static int after_action(int,int next_state){return next_state;}
33 static int after_entry(int,int next_state){return next_state;}
36 // new state set after exit action completed
37 struct active_state_switch_after_exit
39 static int after_guard(int current_state,int){return current_state;}
40 static int after_exit(int,int next_state){return next_state;}
41 static int after_action(int,int next_state){return next_state;}
42 static int after_entry(int,int next_state){return next_state;}
45 // new state set after transition action completed
46 struct active_state_switch_after_transition_action
48 static int after_guard(int current_state,int){return current_state;}
49 static int after_exit(int current_state,int){return current_state;}
50 static int after_action(int,int next_state){return next_state;}
51 static int after_entry(int,int next_state){return next_state;}
55 #endif //BOOST_MSM_ACTIVE_STATE_SWITCHING_POLICIES_H