BondSM_sm.h
Go to the documentation of this file.
1 #ifndef BONDCPP__BONDSM_SM_H_
2 #define BONDCPP__BONDSM_SM_H_
3 
4 /*
5  * ex: set ro:
6  * DO NOT EDIT.
7  * generated by smc (http://smc.sourceforge.net/)
8  * from file : BondSM_sm.sm
9  */
10 
11 
12 #define SMC_USES_IOSTREAMS
13 
14 #include <smclib/statemap.h>
15 
16 // Forward declarations.
17 class SM;
19 class SM_Alive;
21 class SM_Dead;
22 class SM_Default;
23 class BondSMState;
24 class BondSMContext;
25 class BondSM;
26 
27 class BondSMState :
28  public statemap::State
29 {
30 public:
31  BondSMState(const char *name, int stateId)
32  : statemap::State(name, stateId)
33  {};
34 
35  virtual void Entry(BondSMContext&) {}
36  virtual void Exit(BondSMContext&) {}
37 
38  virtual void ConnectTimeout(BondSMContext& context);
39  virtual void Die(BondSMContext& context);
40  virtual void DisconnectTimeout(BondSMContext& context);
41  virtual void HeartbeatTimeout(BondSMContext& context);
42  virtual void SisterAlive(BondSMContext& context);
43  virtual void SisterDead(BondSMContext& context);
44 
45 protected:
46  virtual void Default(BondSMContext& context);
47 };
48 
49 class SM
50 {
51 public:
53  static SM_Alive Alive;
55  static SM_Dead Dead;
56 };
57 
58 class SM_Default :
59  public BondSMState
60 {
61 public:
62  SM_Default(const char *name, int stateId)
63  : BondSMState(name, stateId)
64  {};
65 };
66 
68  public SM_Default
69 {
70 public:
71  SM_WaitingForSister(const char *name, int stateId)
72  : SM_Default(name, stateId)
73  {};
74 
75  void ConnectTimeout(BondSMContext& context);
76  void Die(BondSMContext& context);
77  void SisterAlive(BondSMContext& context);
78  void SisterDead(BondSMContext& context);
79 };
80 
81 class SM_Alive :
82  public SM_Default
83 {
84 public:
85  SM_Alive(const char *name, int stateId)
86  : SM_Default(name, stateId)
87  {};
88 
89  void Die(BondSMContext& context);
90  void HeartbeatTimeout(BondSMContext& context);
91  void SisterAlive(BondSMContext& context);
92  void SisterDead(BondSMContext& context);
93 };
94 
96  public SM_Default
97 {
98 public:
99  SM_AwaitSisterDeath(const char *name, int stateId)
100  : SM_Default(name, stateId)
101  {};
102 
103  void Die(BondSMContext& context);
104  void DisconnectTimeout(BondSMContext& context);
105  void HeartbeatTimeout(BondSMContext& context);
106  void SisterAlive(BondSMContext& context);
107  void SisterDead(BondSMContext& context);
108 };
109 
110 class SM_Dead :
111  public SM_Default
112 {
113 public:
114  SM_Dead(const char *name, int stateId)
115  : SM_Default(name, stateId)
116  {};
117 
118  void ConnectTimeout(BondSMContext& context);
119  void Die(BondSMContext& context);
120  void DisconnectTimeout(BondSMContext& context);
121  void HeartbeatTimeout(BondSMContext& context);
122  void SisterAlive(BondSMContext& context);
123  void SisterDead(BondSMContext& context);
124 };
125 
127  public statemap::FSMContext
128 {
129 public:
131  : FSMContext(SM::WaitingForSister),
132  _owner(owner)
133  {};
134 
135  BondSMContext(BondSM& owner, const statemap::State& state)
136  : FSMContext(state),
137  _owner(owner)
138  {};
139 
140  virtual void enterStartState()
141  {
142  getState().Entry(*this);
143  return;
144  }
145 
146  BondSM& getOwner() const
147  {
148  return (_owner);
149  };
150 
152  {
153  if (_state == NULL)
154  {
156  }
157 
158  return (dynamic_cast<BondSMState&>(*_state));
159  };
160 
162  {
163  (getState()).ConnectTimeout(*this);
164  };
165 
166  void Die()
167  {
168  (getState()).Die(*this);
169  };
170 
172  {
173  (getState()).DisconnectTimeout(*this);
174  };
175 
177  {
178  (getState()).HeartbeatTimeout(*this);
179  };
180 
181  void SisterAlive()
182  {
183  (getState()).SisterAlive(*this);
184  };
185 
186  void SisterDead()
187  {
188  (getState()).SisterDead(*this);
189  };
190 
191 private:
192  BondSM& _owner;
193 };
194 
195 
196 /*
197  * Local variables:
198  * buffer-read-only: t
199  * End:
200  */
201 
202 #endif // BONDCPP__BONDSM_SM_H_
SM_Alive
Definition: BondSM_sm.h:81
SM_AwaitSisterDeath::HeartbeatTimeout
void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:264
BondSMState::ConnectTimeout
virtual void ConnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:17
SM_WaitingForSister::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:105
BondSMContext::DisconnectTimeout
void DisconnectTimeout()
Definition: BondSM_sm.h:171
SM_Default::SM_Default
SM_Default(const char *name, int stateId)
Definition: BondSM_sm.h:62
BondSMState::BondSMState
BondSMState(const char *name, int stateId)
Definition: BondSM_sm.h:31
SM_Dead
Definition: BondSM_sm.h:110
BondSMContext::enterStartState
virtual void enterStartState()
Definition: BondSM_sm.h:140
BondSMState::Default
virtual void Default(BondSMContext &context)
Definition: BondSM_sm.cpp:53
BondSMContext::SisterAlive
void SisterAlive()
Definition: BondSM_sm.h:181
BondSMContext::Die
void Die()
Definition: BondSM_sm.h:166
SM_Alive::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:191
SM_WaitingForSister::SM_WaitingForSister
SM_WaitingForSister(const char *name, int stateId)
Definition: BondSM_sm.h:71
BondSMContext::ConnectTimeout
void ConnectTimeout()
Definition: BondSM_sm.h:161
BondSMContext::BondSMContext
BondSMContext(BondSM &owner)
Definition: BondSM_sm.h:130
SM_AwaitSisterDeath::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:234
SM_AwaitSisterDeath::SM_AwaitSisterDeath
SM_AwaitSisterDeath(const char *name, int stateId)
Definition: BondSM_sm.h:99
statemap::State::State
State()
statemap::FSMContext
BondSMState::DisconnectTimeout
virtual void DisconnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:29
SM_Dead::HeartbeatTimeout
void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:330
BondSMState::Exit
virtual void Exit(BondSMContext &)
Definition: BondSM_sm.h:36
SM_Dead::SM_Dead
SM_Dead(const char *name, int stateId)
Definition: BondSM_sm.h:114
SM_Dead::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:312
SM::AwaitSisterDeath
static SM_AwaitSisterDeath AwaitSisterDeath
Definition: BondSM_sm.h:54
SM
Definition: BondSM_sm.h:49
SM_Default
Definition: BondSM_sm.h:58
statemap.h
BondSMState
Definition: BondSM_sm.h:27
SM::WaitingForSister
static SM_WaitingForSister WaitingForSister
Definition: BondSM_sm.h:52
SM_AwaitSisterDeath::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:282
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
statemap::FSMContext::_state
State * _state
SM_Alive::SM_Alive
SM_Alive(const char *name, int stateId)
Definition: BondSM_sm.h:85
BondSMContext::HeartbeatTimeout
void HeartbeatTimeout()
Definition: BondSM_sm.h:176
statemap::StateUndefinedException
BondSMState::SisterDead
virtual void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:47
SM_Alive::HeartbeatTimeout
void HeartbeatTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:170
SM_WaitingForSister::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:84
SM_WaitingForSister
Definition: BondSM_sm.h:67
SM_Alive::Die
void Die(BondSMContext &context)
Definition: BondSM_sm.cpp:149
SM_AwaitSisterDeath
Definition: BondSM_sm.h:95
statemap::FSMContext::FSMContext
FSMContext(const State &state)
statemap::State
SM::Dead
static SM_Dead Dead
Definition: BondSM_sm.h:55
BondSMState::Entry
virtual void Entry(BondSMContext &)
Definition: BondSM_sm.h:35
SM::Alive
static SM_Alive Alive
Definition: BondSM_sm.h:53
SM_Dead::DisconnectTimeout
void DisconnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:321
BondSMContext::BondSMContext
BondSMContext(BondSM &owner, const statemap::State &state)
Definition: BondSM_sm.h:135
SM_Alive::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:212
BondSMState::SisterAlive
virtual void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:41
BondSMContext::SisterDead
void SisterDead()
Definition: BondSM_sm.h:186
SM_WaitingForSister::ConnectTimeout
void ConnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:63
SM_Dead::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:339
SM_WaitingForSister::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:126
BondSMContext::_owner
BondSM & _owner
Definition: BondSM_sm.h:189
BondSMContext::getState
BondSMState & getState() const
Definition: BondSM_sm.h:151
SM_AwaitSisterDeath::DisconnectTimeout
void DisconnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:243
BondSMContext
Definition: BondSM_sm.h:126
SM_AwaitSisterDeath::SisterAlive
void SisterAlive(BondSMContext &context)
Definition: BondSM_sm.cpp:273
statemap
SM_Dead::ConnectTimeout
void ConnectTimeout(BondSMContext &context)
Definition: BondSM_sm.cpp:303
SM_Dead::SisterDead
void SisterDead(BondSMContext &context)
Definition: BondSM_sm.cpp:348


bondcpp
Author(s): Stuart Glaser
autogenerated on Tue Mar 1 2022 23:53:37