Changeset 10385 for trunk/FACT++/src/StateMachineImp.cc
- Timestamp:
- 04/18/11 13:56:53 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/StateMachineImp.cc
r10370 r10385 124 124 fRunning(false), fExitRequested(0) 125 125 { 126 AddStateName(kSM_NotReady, "NotReady", "State machine not ready, events are ignored."); 127 AddStateName(kSM_Ready, "Ready", "State machine ready to receive events."); 128 AddStateName(kSM_Error, "ERROR", "Common error state."); 129 AddStateName(kSM_FatalError, "FATAL", "A fatal error occured, the eventloop is stopped."); 126 SetDefaultStateNames(); 130 127 } 131 128 … … 150 147 // -------------------------------------------------------------------------- 151 148 // 149 //! Sets the default state names. This function should be called in 150 //! derived classes again if they overwrite SetStateName(). 151 // 152 void StateMachineImp::SetDefaultStateNames() 153 { 154 AddStateName(kSM_NotReady, "NotReady", "State machine not ready, events are ignored."); 155 AddStateName(kSM_Ready, "Ready", "State machine ready to receive events."); 156 AddStateName(kSM_Error, "ERROR", "Common error state."); 157 AddStateName(kSM_FatalError, "FATAL", "A fatal error occured, the eventloop is stopped."); 158 } 159 160 // -------------------------------------------------------------------------- 161 // 152 162 //! Puts the given event into the fifo. The fifo will take over ownership. 153 163 //! Access to fEventQueue is encapsulated by fMutex. … … 400 410 out << endl; 401 411 for (StateNames::const_iterator i=fStateNames.begin(); i!=fStateNames.end(); i++) 402 out << kBold << setw(5) << i->first << kReset << " - " << kBold << i->second.first << kReset << ": " << i->second.second<< endl;412 out << kBold << setw(5) << i->first << kReset << ": " << kYellow << i->second.first << kBlue << " (" << i->second.second << ")" << endl; 403 413 out << endl; 404 414 } … … 659 669 //! readable for to the user, a string can be assigned to each state. 660 670 //! For each state this function can be called only once, i.e. state name 661 //! cannot be overwritten. Negative states are ignore.d 671 //! cannot be overwritten. 672 //! 673 //! Be aware that two states should not have the same name! 662 674 //! 663 675 //! @param state … … 670 682 //! A explanatory text describing the state 671 683 //! 672 //! @todo FIX THE DOCU673 //674 684 void StateMachineImp::AddStateName(const int state, const std::string &name, const std::string &doc) 675 685 {
Note:
See TracChangeset
for help on using the changeset viewer.