Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/statechart/example/Camera/Shooting.hpp @ 33

Last change on this file since 33 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.6 KB
Line 
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//////////////////////////////////////////////////////////////////////////////
8
9
10
11#include "Camera.hpp"
12
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>
19
20#include <boost/mpl/list.hpp>
21#include <boost/config.hpp>
22
23#ifdef BOOST_INTEL
24#  pragma warning( disable: 304 ) // access control not specified
25#endif
26
27
28
29namespace sc = boost::statechart;
30namespace mpl = boost::mpl;
31
32
33
34//////////////////////////////////////////////////////////////////////////////
35struct EvInFocus : sc::event< EvInFocus > {};
36
37struct Focusing;
38struct Shooting : sc::simple_state< Shooting, Camera, Focusing >
39{
40  typedef sc::transition< EvShutterRelease, NotShooting > reactions;
41
42  Shooting();
43  ~Shooting();
44
45  void DisplayFocused( const EvInFocus & )
46  {
47    std::cout << "Focused!\n";
48  }
49};
50
51  struct Focusing : sc::state< Focusing, Shooting >
52  {
53    typedef mpl::list<
54      sc::custom_reaction< EvInFocus >,
55      sc::deferral< EvShutterFull >
56    > reactions;
57
58    Focusing( my_context ctx );
59    sc::result react( const EvInFocus & );
60  };
61
62
63
64#endif
Note: See TracBrowser for help on using the repository browser.