Changeset 10373
- Timestamp:
- 04/15/11 23:03:39 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Connection.cc
r10284 r10373 23 23 // -------- Abbreviations for starting async tasks --------- 24 24 25 int Connection::Write(const Time &t, const char *txt, int qos)25 int Connection::Write(const Time &t, const string &txt, int qos) 26 26 { 27 27 if (fLog) -
trunk/FACT++/src/Connection.h
r10284 r10373 61 61 void HandleSentData(const boost::system::error_code& error, size_t); 62 62 63 int Write(const Time &t, const char *txt, int qos=kInfo);63 int Write(const Time &t, const std::string &txt, int qos=kInfo); 64 64 65 65 virtual void ConnectionEstablished() { } -
trunk/FACT++/src/MessageDim.cc
r10274 r10373 62 62 //! transmitted messages. 63 63 // 64 int MessageDimTX::Write(const Time &t, const char *txt, int qos)64 int MessageDimTX::Write(const Time &t, const string &txt, int qos) 65 65 { 66 66 MessageImp::Write(t, txt, qos); … … 69 69 // hold a local copy of the data. 70 70 setQuality(qos); 71 setData(const_cast<char*>(txt ));71 setData(const_cast<char*>(txt.c_str())); 72 72 const int rc = updateService(); 73 73 … … 112 112 MessageDimRX::MessageDimRX(const std::string &name, MessageImp &imp) 113 113 : fMsg(imp), 114 fDimMessage(Form("%s/MESSAGE", name.c_str()).c_str(), const_cast<char*>(""), this) 114 fDimMessage(Form("%s/MESSAGE", name.c_str()).c_str(), const_cast<char*>(""), this), 115 fConnected(false) 115 116 { 116 117 fMinLogLevel = 0; … … 129 130 130 131 // The server is diconnected. Do nothing 131 if (getInfo()->getTimestamp()==0 )132 if (getInfo()->getTimestamp()==0 || getInfo()->getSize()==1) 132 133 { 134 fConnected=false; 133 135 fMsg.Message("Disconnected."); 134 136 return; 135 137 } 138 139 fConnected=true; 136 140 137 141 // skip all messages with a severity smaller than the minimum log level -
trunk/FACT++/src/MessageDim.h
r10274 r10373 17 17 ~MessageDimTX(); 18 18 19 int Write(const Time &t, const char *txt, int qos=kInfo);19 int Write(const Time &t, const std::string &txt, int qos=kInfo); 20 20 21 21 void SetDebug(bool b=true) { fDebug=b; } … … 34 34 DimStampedInfo fDimMessage; 35 35 36 int fMinLogLevel; 36 int fMinLogLevel; 37 bool fConnected; 37 38 38 39 protected: … … 43 44 44 45 void SetMinLogLevel(int min=0) { fMinLogLevel=min; } 46 bool IsConnected() const { return fConnected; } 45 47 }; 46 48 -
trunk/FACT++/src/MessageImp.cc
r10320 r10373 69 69 //! The severity of the message 70 70 // 71 int MessageImp::Write(const Time &time, const char *txt, int severity)71 int MessageImp::Write(const Time &time, const string &txt, int severity) 72 72 { 73 73 switch (severity) … … 96 96 //! The severity of the message to be passed to Write 97 97 // 98 int MessageImp::Update(const char *txt, int severity)98 int MessageImp::Update(const string &txt, int severity) 99 99 { 100 100 Write(Time(), txt, severity); -
trunk/FACT++/src/MessageImp.h
r10315 r10373 28 28 MessageImp(std::ostream &out=std::cout); 29 29 30 virtual int Write(const Time &time, const char *txt, int qos=kInfo);30 virtual int Write(const Time &time, const std::string &txt, int qos=kInfo); 31 31 32 int Update(const char *txt, int qos=kInfo);33 int Update(const std::string &str, int qos=kInfo) { return Update(str.c_str(), qos); }32 int Update(const std::string &str, int qos=kInfo); 33 int Update(const char *txt, int qos=kInfo) { return Update(std::string(txt), qos); } 34 34 int Update(const std::stringstream &str, int qos=kInfo) { return Update(str.str(), qos); } 35 35 int Update(int qos, const char *fmt, ...); 36 36 37 int Debug(const char *txt) { return Update(txt, kDebug);}38 int Message(const char *txt) { return Update(txt, kMessage); }39 int Info(const char *txt) { return Update(txt, kInfo); }40 int Warn(const char *txt) { return Update(txt, kWarn); }41 int Error(const char *txt) { return Update(txt, kError); }42 int Fatal(const char *txt) { return Update(txt, kFatal); }37 int Debug(const std::string &str) { return Update(str, kDebug); } 38 int Message(const std::string &str) { return Update(str, kMessage); } 39 int Info(const std::string &str) { return Update(str, kInfo); } 40 int Warn(const std::string &str) { return Update(str, kWarn); } 41 int Error(const std::string &str) { return Update(str, kError); } 42 int Fatal(const std::string &str) { return Update(str, kFatal); } 43 43 44 int Debug(const std::string &str) { return Debug(str.c_str());}45 int Message(const std::string &str) { return Message(str.c_str()); }46 int Info(const std::string &str) { return Info(str.c_str()); }47 int Warn(const std::string &str) { return Warn(str.c_str()); }48 int Error(const std::string &str) { return Error(str.c_str()); }49 int Fatal(const std::string &str) { return Fatal(str.c_str()); }44 int Debug(const char *txt) { return Debug(std::string(txt)); } 45 int Message(const char *txt) { return Message(std::string(txt)); } 46 int Info(const char *txt) { return Info(std::string(txt)); } 47 int Warn(const char *txt) { return Warn(std::string(txt)); } 48 int Error(const char *txt) { return Error(std::string(txt)); } 49 int Fatal(const char *txt) { return Fatal(std::string(txt)); } 50 50 51 51 int Debug(const std::stringstream &str) { return Debug(str.str()); } -
trunk/FACT++/src/StateMachineDim.h
r10183 r10373 40 40 41 41 /// Redirect our own logging to fLog 42 int Write(const Time &time, const char *txt, int qos);42 int Write(const Time &time, const std::string &txt, int qos); 43 43 44 44 /// This is an internal function to do some action in case of
Note:
See TracChangeset
for help on using the changeset viewer.