]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/msm/doc/HTML/examples/ipod_functors.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / msm / doc / HTML / examples / ipod_functors.hpp
1 // Copyright 2010 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)
10
11 #ifndef IPOD_FUNCTORS_HPP
12 #define IPOD_FUNCTORS_HPP
13 #include <boost/msm/front/euml/euml.hpp>
14
15 BOOST_MSM_EUML_ACTION(NotHolding_Entry)
16 {
17 template <class Event,class FSM,class STATE>
18 void operator()(Event const&,FSM&,STATE& )
19 {
20 std::cout << "entering: NotHolding" << std::endl;
21 }
22 };
23 BOOST_MSM_EUML_ACTION(Holding_Entry)
24 {
25 template <class Event,class FSM,class STATE>
26 void operator()(Event const&,FSM&,STATE& )
27 {
28 std::cout << "entering: Holding" << std::endl;
29 }
30 };
31 BOOST_MSM_EUML_ACTION(NotPlaying_Entry)
32 {
33 template <class Event,class FSM,class STATE>
34 void operator()(Event const&,FSM&,STATE& )
35 {
36 std::cout << "entering: NotPlaying" << std::endl;
37 }
38 };
39 BOOST_MSM_EUML_ACTION(NoMenuMode_Entry)
40 {
41 template <class Event,class FSM,class STATE>
42 void operator()(Event const&,FSM&,STATE& )
43 {
44 std::cout << "entering: NoMenuMode" << std::endl;
45 }
46 };
47 BOOST_MSM_EUML_ACTION(NoOnOffButton_Entry)
48 {
49 template <class Event,class FSM,class STATE>
50 void operator()(Event const&,FSM&,STATE& )
51 {
52 std::cout << "entering: NoOnOffButton" << std::endl;
53 }
54 };
55 BOOST_MSM_EUML_ACTION(OffDown_Entry)
56 {
57 template <class Event,class FSM,class STATE>
58 void operator()(Event const&,FSM&,STATE& )
59 {
60 std::cout << "entering: OffDown" << std::endl;
61 }
62 };
63 BOOST_MSM_EUML_ACTION(PlayerOff_Entry)
64 {
65 template <class Event,class FSM,class STATE>
66 void operator()(Event const&,FSM&,STATE& )
67 {
68 std::cout << "entering: PlayerOff" << std::endl;
69 }
70 };
71 BOOST_MSM_EUML_ACTION(CheckMiddleButton_Entry)
72 {
73 template <class Event,class FSM,class STATE>
74 void operator()(Event const&,FSM&,STATE& )
75 {
76 std::cout << "entering: CheckMiddleButton" << std::endl;
77 }
78 };
79 BOOST_MSM_EUML_ACTION(Playing_Entry)
80 {
81 template <class Event,class FSM,class STATE>
82 void operator()(Event const&,FSM& fsm,STATE& )
83 {
84 std::cout << "entering: Playing" << std::endl;
85 std::cout << "playing song:" << fsm.get_attribute(m_SongIndex) << std::endl;
86 }
87 };
88 BOOST_MSM_EUML_ACTION(WaitingForNextPrev_Entry)
89 {
90 template <class Event,class FSM,class STATE>
91 void operator()(Event const&,FSM&,STATE& )
92 {
93 std::cout << "entering: WaitingForNextPrev" << std::endl;
94 }
95 };
96 BOOST_MSM_EUML_ACTION(Paused_Entry)
97 {
98 template <class Event,class FSM,class STATE>
99 void operator()(Event const&,FSM&,STATE& )
100 {
101 std::cout << "entering: Paused" << std::endl;
102 }
103 };
104 BOOST_MSM_EUML_ACTION(WaitingForEnd_Entry)
105 {
106 template <class Event,class FSM,class STATE>
107 void operator()(Event const&,FSM&,STATE& )
108 {
109 std::cout << "entering: OffDown" << std::endl;
110 }
111 };
112 BOOST_MSM_EUML_ACTION(NoForward_Entry)
113 {
114 template <class Event,class FSM,class STATE>
115 void operator()(Event const&,FSM&,STATE& )
116 {
117 std::cout << "entering: NoForward" << std::endl;
118 }
119 };
120 BOOST_MSM_EUML_ACTION(ForwardPressed_Entry)
121 {
122 template <class Event,class FSM,class STATE>
123 void operator()(Event const&,FSM&,STATE& )
124 {
125 std::cout << "entering: ForwardPressed" << std::endl;
126 }
127 };
128 BOOST_MSM_EUML_ACTION(ForwardPressed_Exit)
129 {
130 template <class Event,class FSM,class STATE>
131 void operator()(Event const&,FSM&,STATE& )
132 {
133 std::cout << "leaving: ForwardPressed" << std::endl;
134 }
135 };
136 BOOST_MSM_EUML_ACTION(FastForward_Entry)
137 {
138 template <class Event,class FSM,class STATE>
139 void operator()(Event const&,FSM&,STATE& )
140 {
141 std::cout << "entering: FastForward" << std::endl;
142 }
143 };
144 BOOST_MSM_EUML_ACTION(FastForward_Exit)
145 {
146 template <class Event,class FSM,class STATE>
147 void operator()(Event const&,FSM&,STATE& )
148 {
149 std::cout << "leaving: FastForward" << std::endl;
150 }
151 };
152 BOOST_MSM_EUML_ACTION(StdDisplay_Entry)
153 {
154 template <class Event,class FSM,class STATE>
155 void operator()(Event const&,FSM&,STATE& )
156 {
157 std::cout << "entering: StdDisplay" << std::endl;
158 }
159 };
160 BOOST_MSM_EUML_ACTION(SetPosition_Entry)
161 {
162 template <class Event,class FSM,class STATE>
163 void operator()(Event const&,FSM&,STATE& )
164 {
165 std::cout << "entering: SetPosition" << std::endl;
166 }
167 };
168 BOOST_MSM_EUML_ACTION(SetMark_Entry)
169 {
170 template <class Event,class FSM,class STATE>
171 void operator()(Event const&,FSM&,STATE& )
172 {
173 std::cout << "entering: SetMark" << std::endl;
174 }
175 };
176 BOOST_MSM_EUML_ACTION(PlayingExit_Entry)
177 {
178 template <class Event,class FSM,class STATE>
179 void operator()(Event const&,FSM&,STATE& )
180 {
181 std::cout << "entering: PlayingExit" << std::endl;
182 }
183 };
184 BOOST_MSM_EUML_ACTION(WaitingForSongChoice_Entry)
185 {
186 template <class Event,class FSM,class STATE>
187 void operator()(Event const&,FSM&,STATE& )
188 {
189 std::cout << "entering: WaitingForSongChoice" << std::endl;
190 }
191 };
192 BOOST_MSM_EUML_ACTION(StartCurrentSong_Entry)
193 {
194 template <class Event,class FSM,class STATE>
195 void operator()(Event const&,FSM&,STATE& )
196 {
197 std::cout << "entering: StartCurrentSong" << std::endl;
198 }
199 };
200 BOOST_MSM_EUML_ACTION(MenuExit_Entry)
201 {
202 template <class Event,class FSM,class STATE>
203 void operator()(Event const&,FSM&,STATE& )
204 {
205 std::cout << "entering: MenuExit" << std::endl;
206 }
207 };
208 BOOST_MSM_EUML_ACTION(show_selected_song)
209 {
210 template <class FSM,class EVT,class SourceState,class TargetState>
211 void operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState& )
212 {
213 std::cout << "selecting song:" << fsm.get_attribute(m_SongIndex) << std::endl;
214 }
215 };
216 BOOST_MSM_EUML_ACTION(do_fast_forward)
217 {
218 template <class FSM,class EVT,class SourceState,class TargetState>
219 void operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState& )
220 {
221 std::cout << "moving song forward..." << std::endl;
222 }
223 };
224 BOOST_MSM_EUML_ACTION(show_playing_song)
225 {
226 template <class FSM,class EVT,class SourceState,class TargetState>
227 void operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState& )
228 {
229 std::cout << "playing song:" << fsm.get_attribute(m_SongIndex) << std::endl;
230 }
231 };
232 BOOST_MSM_EUML_ACTION(show_player_off)
233 {
234 template <class FSM,class EVT,class SourceState,class TargetState>
235 void operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState& )
236 {
237 std::cout << "turning player off" << std::endl;
238 }
239 };
240 BOOST_MSM_EUML_ACTION(show_player_on)
241 {
242 template <class FSM,class EVT,class SourceState,class TargetState>
243 void operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState& )
244 {
245 std::cout << "turning player on" << std::endl;
246 }
247 };
248 #endif