Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/statechart/example/Camera/Camera.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.7 KB
Line 
1#ifndef BOOST_STATECHART_EXAMPLE_CAMERA_HPP_INCLUDED
2#define BOOST_STATECHART_EXAMPLE_CAMERA_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 <boost/statechart/event.hpp>
12#include <boost/statechart/state_machine.hpp>
13#include <boost/statechart/simple_state.hpp>
14#include <boost/statechart/custom_reaction.hpp>
15
16#include <boost/config.hpp>
17
18#ifdef BOOST_INTEL
19#  pragma warning( disable: 304 ) // access control not specified
20#endif
21
22
23
24namespace sc = boost::statechart;
25
26
27
28//////////////////////////////////////////////////////////////////////////////
29struct EvShutterHalf : sc::event< EvShutterHalf > {};
30struct EvShutterFull : sc::event< EvShutterFull > {};
31struct EvShutterRelease : sc::event< EvShutterRelease > {};
32struct EvConfig : sc::event< EvConfig > {};
33
34struct NotShooting;
35struct Camera : sc::state_machine< Camera, NotShooting >
36{
37    bool IsMemoryAvailable() const { return true; }
38    bool IsBatteryLow() const { return false; }
39};
40
41struct Idle;
42struct NotShooting : sc::simple_state< NotShooting, Camera, Idle >
43{
44  typedef sc::custom_reaction< EvShutterHalf > reactions;
45
46  NotShooting();
47  ~NotShooting();
48
49  sc::result react( const EvShutterHalf & );
50};
51
52  struct Idle : sc::simple_state< Idle, NotShooting >
53  {
54    typedef sc::custom_reaction< EvConfig > reactions;
55
56    Idle();
57    ~Idle();
58
59    sc::result react( const EvConfig & );
60  };
61
62
63
64#endif
Note: See TracBrowser for help on using the repository browser.