Changeset 10379
- Timestamp:
- 04/18/11 10:56:51 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/StateMachineDim.cc
r10374 r10379 65 65 StateMachineDim::StateMachineDim(ostream &out, const std::string &name) 66 66 : StateMachine(out, name), DimStart(name, *this), fLog(name, out), 67 fSrvState(Form("%s/STATE", name.c_str()).c_str(), const_cast<char*>("")), 68 fSrvVersion(Form("%s/VERSION", name.c_str()).c_str(), const_cast<int&>(fVersion)) 67 fSrvState(Form("%s/STATE", name.c_str()).c_str(), const_cast<char*>("")), 68 fSrvVersion(Form("%s/VERSION", name.c_str()).c_str(), const_cast<int&>(fVersion)), 69 fDescriptionStates(Form("%s/STATE_LIST", name.c_str()).c_str(), const_cast<char*>("")) 69 70 { 70 71 // WARNING: This exit handler is GLOBAL! 71 72 DimServer::addExitHandler(this); 73 74 for (StateNames::const_iterator i=fStateNames.begin(); i!=fStateNames.end(); i++) 75 DistStateName(i->first, i->second.first, i->second.second); 72 76 } 73 77 … … 83 87 { 84 88 return new EventDim(targetstate, GetName()+"/"+name, fmt, this); 89 } 90 91 void StateMachineDim::DistStateName(const int state, const std::string &name, const std::string &doc) 92 { 93 ostringstream out; 94 out << reinterpret_cast<char*>(fDescriptionStates.itsData); 95 out << state << ':' << name << '=' << doc << '\n'; 96 97 fDescriptionStates.setData(const_cast<char*>(out.str().c_str())); 98 fDescriptionStates.updateService(); 99 } 100 101 void StateMachineDim::AddStateName(const int state, const std::string &name, const std::string &doc) 102 { 103 StateMachineImp::AddStateName(state, name, doc); 104 DistStateName(state, name, doc); 85 105 } 86 106 -
trunk/FACT++/src/StateMachineDim.h
r10373 r10379 33 33 static const int fVersion; /// Version number 34 34 35 DimService fSrvState; /// DimService offering fCurrentState 36 DimService fSrvVersion; /// DimService offering fVersion 35 DimService fSrvState; /// DimService offering fCurrentState 36 DimService fSrvVersion; /// DimService offering fVersion 37 38 DimService fDescriptionStates; /// DimService propagating the state descriptions 37 39 38 40 void exitHandler(int code); /// Overwritten DimCommand::exitHandler. … … 50 52 public: 51 53 StateMachineDim(std::ostream &out=std::cout, const std::string &name="DEFAULT"); 54 55 void AddStateName(const int state, const std::string &name, const std::string &doc=""); 56 void DistStateName(const int state, const std::string &name, const std::string &doc=""); 52 57 }; 53 58
Note:
See TracChangeset
for help on using the changeset viewer.