FACT++  1.0
StateMachineDim::StateMachineDim ( std::ostream &  out = std::cout,
const std::string &  name = "DEFAULT" 
)

The constrcutor first initialized DimStart with the given machine name. DimStart is just a wrapper which constructor calls DimServer::start() to ensure that initializing the Dim sub-system, is the first what is done.

The second objet instantiated is the MessageDim class which offers the MESSAGE service used to broadcast logging messages to other Dim clients.

After this the services STATE and VERSION are setup. STATE will be used to broadcast the state of the machine. Version broadcasts the global version number of the StateMachineDim implementation

After redirecting the handler which handels dim's EXIT command to ourself (it will then call StateMachineDim::exitHandler) and adding human readable state names for the default states implemented by StateMachingImp the state is set to kSM_Initializing. Warning: The EXIT handler is global!

Parameters
nameThe name with which the dim-services should be prefixed, e.g. "DRIVE" will lead to "DRIVE/SERVICE". It is also propagated to DimServer::start()
outA refrence to an ostream which allows to redirect the log-output to something else than cout. The default is cout. The reference is propagated to fLog
Todo:
  • Shell the VERSION be set from the derived class?

Definition at line 63 of file StateMachineDim.cc.

References StateMachineImp::SetDefaultStateNames().

64  : DimLog(out, name), DimStart(name, DimLog::fLog), StateMachineImp(out, name),
65  fDescriptionStates(name+"/STATE_LIST", "C",
66  "Provides a list with descriptions for each service."
67  "|StateList[string]:A \\n separated list of the form id:name=description"),
68  fSrvState(name+"/STATE", "C",
69  "Provides the state of the state machine as quality of service."
70  "|Text[string]:A human readable string sent by the last state change.")
71  // fSrvVersion((name+"/VERSION").c_str(), const_cast<int&>(fVersion)),
72 {
74 }
DimStart(const std::string &name, MessageImp &imp)
DimDescribedService fDescriptionStates
Version number.
DimLog(std::ostream &out, const std::string &name)
DimDescribedService fSrvState
DimService propagating the state descriptions.
MessageDimTX fLog
StateMachineImp(std::ostream &out=std::cout, const std::string &name="")

+ Here is the call graph for this function: