FACT++  1.0
StateMachine.cc
Go to the documentation of this file.
1 // **************************************************************************
19 // **************************************************************************
20 #include "StateMachine.h"
21 
22 #include "WindowLog.h"
23 
24 #include "Event.h"
25 #include "Time.h"
26 #include "Shell.h"
27 
28 #include "tools.h"
29 
30 using namespace std;
31 
32 // --------------------------------------------------------------------------
33 //
39 EventImp *StateMachine::CreateEvent(const string &name, const string &fmt)
40 {
41  return new Event(GetName()+'/'+name, fmt);
42 }
43 
44 // --------------------------------------------------------------------------
45 //
62 //
63 bool StateMachine::ProcessCommand(const std::string &str, const char *ptr, size_t siz)
64 {
65  EventImp *evt = FindEvent(str);
66  if (!evt)
67  return false;
68 
69  PostEvent(*evt, ptr, siz);
70  return true;
71 }
72 
A general base-class describing events issues in a state machine.
Definition: EventImp.h:11
bool ProcessCommand(const std::string &str, const char *ptr, size_t siz)
Definition: StateMachine.cc:63
char str[80]
Definition: test_client.c:7
STL namespace.
EventImp * CreateEvent(const std::string &name, const std::string &fmt)
Definition: StateMachine.cc:39
Concerete implementation of an EventImp stroring name, format, data and time.
Definition: Event.h:6