Changeset 10383
- Timestamp:
- 04/18/11 11:01:41 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/MessageImp.cc
r10373 r10383 37 37 MessageImp::MessageImp(ostream &out) : fOut(out) 38 38 { 39 } 40 41 // -------------------------------------------------------------------------- 42 // 43 //! This is a special write function formatting a string when the 44 //! state of a state machine has changed. 45 //! 46 //! If the state is <-1 nothing is done. 47 //! 48 //! Calls the virtual function IndicateStateChange 49 //! 50 //! @param time 51 //! The time assigned to the message 52 //! 53 //! @param server 54 //! The server name which is emitting the state change 55 //! 56 //! @param msg 57 //! The message text 58 //! 59 //! @param state 60 //! The new state of the system 61 // 62 void MessageImp::StateChanged(const Time &time, const string &server, const string &msg, int state) 63 { 64 if (state<-1) 65 return; 66 67 ostringstream out; 68 out << server << ": Changed state to " << state << " '" << msg << "' received."; 69 70 Write(time, out.str(), MessageImp::kInfo); 71 72 IndicateStateChange(time, server); 39 73 } 40 74 -
trunk/FACT++/src/MessageImp.h
r10373 r10383 28 28 MessageImp(std::ostream &out=std::cout); 29 29 30 virtual void IndicateStateChange(const Time &time, const std::string &server) { } 31 void StateChanged(const Time &time, const std::string &server, const std::string &msg, int state); 30 32 virtual int Write(const Time &time, const std::string &txt, int qos=kInfo); 31 33
Note:
See TracChangeset
for help on using the changeset viewer.