]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/statechart/example/Camera/Camera.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / statechart / example / Camera / Camera.cpp
1 //////////////////////////////////////////////////////////////////////////////
2 // Copyright 2002-2006 Andreas Huber Doenni
3 // Distributed under the Boost Software License, Version 1.0. (See accompany-
4 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 //////////////////////////////////////////////////////////////////////////////
6
7
8
9 #include "Precompiled.hpp"
10 #include "Camera.hpp"
11 #include "Configuring.hpp"
12 #include "Shooting.hpp"
13
14
15
16 //////////////////////////////////////////////////////////////////////////////
17 NotShooting::NotShooting()
18 {
19 std::cout << "Entering NotShooting\n";
20 }
21
22 NotShooting::~NotShooting()
23 {
24 std::cout << "Exiting NotShooting\n";
25 }
26
27 sc::result NotShooting::react( const EvShutterHalf & )
28 {
29 if ( context< Camera >().IsBatteryLow() )
30 {
31 return forward_event();
32 }
33 else
34 {
35 return transit< Shooting >();
36 }
37 }
38
39 //////////////////////////////////////////////////////////////////////////////
40 Idle::Idle()
41 {
42 std::cout << "Entering Idle\n";
43 }
44
45 Idle::~Idle()
46 {
47 std::cout << "Exiting Idle\n";
48 }
49
50 sc::result Idle::react( const EvConfig & )
51 {
52 return transit< Configuring >();
53 }