FACT++  1.0
template<class T>
StateMachineFAD< T >::StateMachineFAD ( const string &  name = "",
ostream &  out = cout 
)
inline

Definition at line 213 of file dclient5.cc.

References StateMachineFAD< T >::Command(), Connection::SetEndpoint(), Connection::SetLogStream(), StateMachineFAD< T >::Start(), and Connection::StartConnect().

213  :
214  T(out, name),
215  c1(*this, *this), c2(*this, *this), c3(*this, *this), c4(*this, *this),
216  c5(*this, *this), c6(*this, *this), c7(*this, *this), c8(*this, *this),
217  c9(*this, *this), fTimers(out)
218  {
219 // c1.SetEndpoint();
220  c2.SetEndpoint("localhost", 4001);
221  c3.SetEndpoint("ftmboard1.ethz.ch", 5000);
222  c4.SetEndpoint("localhost", 4003);
223  c5.SetEndpoint("localhost", 4004);
224  c6.SetEndpoint("localhost", 4005);
225  c7.SetEndpoint("localhost", 4006);
226  c8.SetEndpoint("localhost", 4007);
227  c9.SetEndpoint("localhost", 4008);
228 
229  c1.SetLogStream(this);
230  c2.SetLogStream(this);
231  c3.SetLogStream(this);
232  c4.SetLogStream(this);
233  c5.SetLogStream(this);
234  c6.SetLogStream(this);
235  c7.SetLogStream(this);
236  c8.SetLogStream(this);
237  c9.SetLogStream(this);
238 
239  c1.StartConnect(); // This sets the connection to "open"
240  c2.StartConnect(); // This sets the connection to "open"
241  c3.StartConnect(); // This sets the connection to "open"
242  //c4.StartConnect(); // This sets the connection to "open"
243  //c5.StartConnect(); // This sets the connection to "open"
244  //c6.StartConnect(); // This sets the connection to "open"
245  //c7.StartConnect(); // This sets the connection to "open"
246  //c8.StartConnect(); // This sets the connection to "open"
247  //c9.StartConnect(); // This sets the connection to "open"
248 
249  AddStateName(kSM_Disconnected, "Disconnected");
250  AddStateName(kSM_Connecting, "Connecting"); // Some connected
251  AddStateName(kSM_Connected, "Connected");
252  AddStateName(kSM_Running, "Running");
253  AddStateName(kSM_SomeRunning, "SomeRunning");
254  AddStateName(kSM_Starting, "Starting");
255  AddStateName(kSM_Stopping, "Stopping");
256 
257  AddEvent(kSM_Running, "START", kSM_Connected).
258  AssignFunction(boost::bind(&StateMachineFAD::Start, this, _1, 5));
259  AddEvent(kSM_Connected, "STOP", kSM_Running);
260 
261  AddEvent("TIME", kSM_Running);
262  AddEvent("LED", kSM_Connected);
263 
264  T::AddEvent("TESTI", "I");
265  T::AddEvent("TESTI2", "I:2");
266  T::AddEvent("TESTIF", "I:2;F:2");
267  T::AddEvent("TESTIC", "I:2;C");
268 
269  T::AddEvent("CMD", "C").
270  AssignFunction(boost::bind(&StateMachineFAD::Command, this, _1));
271 
272  AddEvent(kSM_Reconnect, "RECONNECT");
273 
274  AddEvent(kSM_SetUrl, "SETURL", "C");
275  }
ConnectionFAD c7
Definition: dclient5.cc:201
ConnectionFAD c8
Definition: dclient5.cc:202
ConnectionFAD c5
Definition: dclient5.cc:199
ConnectionFAD c4
Definition: dclient5.cc:198
ConnectionFAD c9
Definition: dclient5.cc:203
void SetEndpoint(const std::string &addr, int port)
ConnectionFAD c1
Definition: dclient5.cc:195
virtual void StartConnect()
Definition: Connection.cc:352
ConnectionFAD c3
Definition: dclient5.cc:197
void SetLogStream(MessageImp *log)
Definition: Connection.h:50
int Start(const EventImp &evt, int i)
Definition: dclient5.cc:306
ConnectionFAD c6
Definition: dclient5.cc:200
int Command(const EventImp &evt)
Definition: dclient5.cc:277
Timers fTimers
Definition: dclient5.cc:211
ConnectionFAD c2
Definition: dclient5.cc:196

+ Here is the call graph for this function: