HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEFunctionalObjectBase.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_FUNCTIONAL_OBJECT_BASE_HPP
15 #define DRCE_FUNCTIONAL_OBJECT_BASE_HPP
16 
17 #include <Poco/Timestamp.h>
18 #include <sstream>
19 #include <iostream>
20 
21 #include "LoggerStream.hpp"
22 
23 namespace HCE
24 {
25 namespace drce
26 {
27 //-----------------------------------------------------------------------------
29 {
30 public:
32  virtual ~DRCEFunctionalObjectBase(void) {}
33 
34  void setErrorMsg(const std::string& errorMsg_) {errorMsg=errorMsg_;}
35  std::string getErrorMsg(void) const {return errorMsg;}
36 
37  void setErrorCode(unsigned int errorCode_) {errorCode=errorCode_;}
38  unsigned int getErrorCode(void) const {return errorCode;}
39 
40  void isError(bool isError_) {_isError=isError_;}
41  bool isError(void) const {return _isError;}
42 
43  void resetLogStream(void);
44  void setLogStream(std::ostream& os);
45 
46  std::string logMsg(bool isReset=true);
47  std::ostream& log(void);
48 
49  void setLoggable(Loggable loggable);
50  void resetLoggable(void);
51 
52 protected:
53  bool insensitiveCompare(const std::string& lhs, const std::string& rhs);
54  size_t getElapsedTimeMsec(const Poco::Timestamp& ts);
55 protected:
56  std::string errorMsg;
57  unsigned int errorCode;
58  bool _isError;
59 
61 };
62 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 } // namespace drce
65 } // namespace HCE
66 
67 #endif // DRCE_FUNCTIONAL_OBJECT_BASE_HPP