BondSM_sm.cpp
Go to the documentation of this file.
1 /*
2  * ex: set ro:
3  * DO NOT EDIT.
4  * generated by smc (http://smc.sourceforge.net/)
5  * from file : BondSM_sm.sm
6  */
7 
8 #include "bondcpp/bond.h"
9 #include "bondcpp/BondSM_sm.h"
10 
11 // Static class declarations.
12 SM_WaitingForSister SM::WaitingForSister("SM::WaitingForSister", 0);
13 SM_Alive SM::Alive("SM::Alive", 1);
14 SM_AwaitSisterDeath SM::AwaitSisterDeath("SM::AwaitSisterDeath", 2);
15 SM_Dead SM::Dead("SM::Dead", 3);
16 
18 {
19  Default(context);
20  return;
21 }
22 
24 {
25  Default(context);
26  return;
27 }
28 
30 {
31  Default(context);
32  return;
33 }
34 
36 {
37  Default(context);
38  return;
39 }
40 
42 {
43  Default(context);
44  return;
45 }
46 
48 {
49  Default(context);
50  return;
51 }
52 
54 {
55  throw (
57  context.getState().getName(),
58  context.getTransition()));
59 
60  return;
61 }
62 
64 {
65  BondSM& ctxt(context.getOwner());
66 
67  (context.getState()).Exit(context);
68  context.clearState();
69  try
70  {
71  ctxt.Death();
72  context.setState(SM::Dead);
73  }
74  catch (...)
75  {
76  context.setState(SM::Dead);
77  throw;
78  }
79  (context.getState()).Entry(context);
80 
81  return;
82 }
83 
85 {
86  BondSM& ctxt(context.getOwner());
87 
88  (context.getState()).Exit(context);
89  context.clearState();
90  try
91  {
92  ctxt.Death();
93  context.setState(SM::Dead);
94  }
95  catch (...)
96  {
97  context.setState(SM::Dead);
98  throw;
99  }
100  (context.getState()).Entry(context);
101 
102  return;
103 }
104 
106 {
107  BondSM& ctxt(context.getOwner());
108 
109  (context.getState()).Exit(context);
110  context.clearState();
111  try
112  {
113  ctxt.Connected();
114  context.setState(SM::Alive);
115  ctxt.Heartbeat();
116  }
117  catch (...)
118  {
119  context.setState(SM::Alive);
120  throw;
121  }
122  (context.getState()).Entry(context);
123 
124  return;
125 }
126 
128 {
129  BondSM& ctxt(context.getOwner());
130 
131  (context.getState()).Exit(context);
132  context.clearState();
133  try
134  {
135  ctxt.Connected();
136  ctxt.SisterDied();
137  ctxt.Death();
138  context.setState(SM::Dead);
139  }
140  catch (...)
141  {
142  context.setState(SM::Dead);
143  throw;
144  }
145  (context.getState()).Entry(context);
146 
147  return;
148 }
149 
151 {
152  BondSM& ctxt(context.getOwner());
153 
154  (context.getState()).Exit(context);
155  context.clearState();
156  try
157  {
158  ctxt.StartDying();
160  }
161  catch (...)
162  {
164  throw;
165  }
166  (context.getState()).Entry(context);
167 
168  return;
169 }
170 
172 {
173  BondSM& ctxt(context.getOwner());
174 
175  (context.getState()).Exit(context);
176  context.clearState();
177  try
178  {
179  ctxt.Death();
180  context.setState(SM::Dead);
181  }
182  catch (...)
183  {
184  context.setState(SM::Dead);
185  throw;
186  }
187  (context.getState()).Entry(context);
188 
189  return;
190 }
191 
193 {
194  BondSM& ctxt(context.getOwner());
195 
196  (context.getState()).Exit(context);
197  context.clearState();
198  try
199  {
200  ctxt.Heartbeat();
201  context.setState(SM::Alive);
202  }
203  catch (...)
204  {
205  context.setState(SM::Alive);
206  throw;
207  }
208  (context.getState()).Entry(context);
209 
210  return;
211 }
212 
214 {
215  BondSM& ctxt(context.getOwner());
216 
217  (context.getState()).Exit(context);
218  context.clearState();
219  try
220  {
221  ctxt.SisterDied();
222  ctxt.Death();
223  context.setState(SM::Dead);
224  }
225  catch (...)
226  {
227  context.setState(SM::Dead);
228  throw;
229  }
230  (context.getState()).Entry(context);
231 
232  return;
233 }
234 
236 {
237  (context.getState()).Exit(context);
239  (context.getState()).Entry(context);
240 
241  return;
242 }
243 
245 {
246  BondSM& ctxt(context.getOwner());
247 
248  (context.getState()).Exit(context);
249  context.clearState();
250  try
251  {
252  ctxt.Death();
253  context.setState(SM::Dead);
254  }
255  catch (...)
256  {
257  context.setState(SM::Dead);
258  throw;
259  }
260  (context.getState()).Entry(context);
261 
262  return;
263 }
264 
266 {
267  (context.getState()).Exit(context);
269  (context.getState()).Entry(context);
270 
271  return;
272 }
273 
275 {
276  (context.getState()).Exit(context);
278  (context.getState()).Entry(context);
279 
280  return;
281 }
282 
284 {
285  BondSM& ctxt(context.getOwner());
286 
287  (context.getState()).Exit(context);
288  context.clearState();
289  try
290  {
291  ctxt.Death();
292  context.setState(SM::Dead);
293  }
294  catch (...)
295  {
296  context.setState(SM::Dead);
297  throw;
298  }
299  (context.getState()).Entry(context);
300 
301  return;
302 }
303 
305 {
306  (context.getState()).Exit(context);
307  context.setState(SM::Dead);
308  (context.getState()).Entry(context);
309 
310  return;
311 }
312 
314 {
315  (context.getState()).Exit(context);
316  context.setState(SM::Dead);
317  (context.getState()).Entry(context);
318 
319  return;
320 }
321 
323 {
324  (context.getState()).Exit(context);
325  context.setState(SM::Dead);
326  (context.getState()).Entry(context);
327 
328  return;
329 }
330 
332 {
333  (context.getState()).Exit(context);
334  context.setState(SM::Dead);
335  (context.getState()).Entry(context);
336 
337  return;
338 }
339 
341 {
342  (context.getState()).Exit(context);
343  context.setState(SM::Dead);
344  (context.getState()).Entry(context);
345 
346  return;
347 }
348 
350 {
351  (context.getState()).Exit(context);
352  context.setState(SM::Dead);
353  (context.getState()).Entry(context);
354 
355  return;
356 }
357 
358 /*
359  * Local variables:
360  * buffer-read-only: t
361  * End:
362  */
SM_Alive
Definition: BondSM_sm.h:81
SM_AwaitSisterDeath::HeartbeatTimeout
void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:265
BondSMState::ConnectTimeout
virtual void ConnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:17
bond.h
SM_WaitingForSister::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:105
SM_Dead
Definition: BondSM_sm.h:110
BondSMState::Default
virtual void Default(BondSMContext &context)
Definition: BondSM_sm.cpp:53
SM_Alive::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:192
BondSM::Heartbeat
void Heartbeat()
Definition: bond.cpp:409
BondSM::SisterDied
void SisterDied()
Definition: bond.cpp:394
SM_AwaitSisterDeath::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:235
BondSMState::DisconnectTimeout
virtual void DisconnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:29
SM_Dead::HeartbeatTimeout
void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:331
BondSMState::Exit
virtual void Exit(BondSMContext &)
Definition: BondSM_sm.h:36
SM_Dead::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:313
SM::AwaitSisterDeath
static SM_AwaitSisterDeath AwaitSisterDeath
Definition: BondSM_sm.h:54
BondSM::Connected
void Connected()
Definition: bond.cpp:385
SM::WaitingForSister
static SM_WaitingForSister WaitingForSister
Definition: BondSM_sm.h:52
SM_AwaitSisterDeath::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:283
BondSMContext::getOwner
BondSM & getOwner() const
Definition: BondSM_sm.h:146
BondSM
Definition: bond.h:200
BondSMState::Die
virtual void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:23
BondSMState::HeartbeatTimeout
virtual void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:35
BondSMState::SisterDead
virtual void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:47
SM_Alive::HeartbeatTimeout
void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:171
SM_WaitingForSister::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:84
statemap::FSMContext::setState
void setState(const State &state)
statemap::TransitionUndefinedException
BondSM::StartDying
void StartDying()
Definition: bond.cpp:414
SM_WaitingForSister
Definition: BondSM_sm.h:67
SM_Alive::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:150
SM_AwaitSisterDeath
Definition: BondSM_sm.h:95
SM::Dead
static SM_Dead Dead
Definition: BondSM_sm.h:55
BondSMState::Entry
virtual void Entry(BondSMContext &)
Definition: BondSM_sm.h:35
statemap::FSMContext::clearState
void clearState()
SM::Alive
static SM_Alive Alive
Definition: BondSM_sm.h:53
SM_Dead::DisconnectTimeout
void DisconnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:322
SM_Alive::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:213
BondSMState::SisterAlive
virtual void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:41
statemap::State::getName
const char * getName() const
BondSM_sm.h
statemap::FSMContext::getTransition
char * getTransition()
BondSM::Death
void Death()
Definition: bond.cpp:399
SM_WaitingForSister::ConnectTimeout
void ConnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:63
SM_Dead::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:340
SM_WaitingForSister::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:127
BondSMContext::getState
BondSMState & getState() const
Definition: BondSM_sm.h:151
SM_AwaitSisterDeath::DisconnectTimeout
void DisconnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:244
BondSMContext
Definition: BondSM_sm.h:126
SM_AwaitSisterDeath::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:274
SM_Dead::ConnectTimeout
void ConnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:304
SM_Dead::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:349


bondcpp
Author(s): Stuart Glaser
autogenerated on Mon Apr 28 2025 02:56:34