1 #ifndef BOOST_STATECHART_EXAMPLE_SHOOTING_HPP_INCLUDED
2 #define BOOST_STATECHART_EXAMPLE_SHOOTING_HPP_INCLUDED
3 //////////////////////////////////////////////////////////////////////////////
4 // Copyright 2002-2006 Andreas Huber Doenni
5 // Distributed under the Boost Software License, Version 1.0. (See accompany-
6 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 //////////////////////////////////////////////////////////////////////////////
13 #include <boost/statechart/event.hpp>
14 #include <boost/statechart/simple_state.hpp>
15 #include <boost/statechart/state.hpp>
16 #include <boost/statechart/transition.hpp>
17 #include <boost/statechart/custom_reaction.hpp>
18 #include <boost/statechart/deferral.hpp>
20 #include <boost/mpl/list.hpp>
21 #include <boost/config.hpp>
24 # pragma warning( disable: 304 ) // access control not specified
29 namespace sc = boost::statechart;
30 namespace mpl = boost::mpl;
34 //////////////////////////////////////////////////////////////////////////////
35 struct EvInFocus : sc::event< EvInFocus > {};
38 struct Shooting : sc::simple_state< Shooting, Camera, Focusing >
40 typedef sc::transition< EvShutterRelease, NotShooting > reactions;
45 void DisplayFocused( const EvInFocus & )
47 std::cout << "Focused!\n";
51 struct Focusing : sc::state< Focusing, Shooting >
54 sc::custom_reaction< EvInFocus >,
55 sc::deferral< EvShutterFull >
58 Focusing( my_context ctx );
59 sc::result react( const EvInFocus & );