HCE project C++ developers source code library
1.1.1
HCE project developer library
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
DRCEFunctionalObjectBase.cpp
Go to the documentation of this file.
1
#include <algorithm>
2
#include <ctype.h>
3
4
#include "
DRCEFunctionalObjectBase.hpp
"
5
#include "
DRCEError.hpp
"
6
7
namespace
HCE
8
{
9
namespace
drce
10
{
11
//-----------------------------------------------------------------------------
12
DRCEFunctionalObjectBase::DRCEFunctionalObjectBase
(
void
)
13
:
errorMsg
(
""
),
errorCode
(
NO_ERROR
), _isError(false), logger()
14
{
15
}
16
//-----------------------------------------------------------------------------
17
void
DRCEFunctionalObjectBase::resetLogStream
(
void
)
18
{
19
logger
.
resetLogStream
();
20
}
21
//-----------------------------------------------------------------------------
22
void
DRCEFunctionalObjectBase::setLogStream
(std::ostream& os)
23
{
24
logger
.
setLogStream
(os);
25
}
26
//-----------------------------------------------------------------------------
27
std::string
DRCEFunctionalObjectBase::logMsg
(
bool
isReset)
28
{
29
return
logger
.
logMsg
(isReset);
30
}
31
//-----------------------------------------------------------------------------
32
std::ostream&
DRCEFunctionalObjectBase::log
(
void
)
33
{
34
return
logger
.
log
();
35
}
36
//-----------------------------------------------------------------------------
37
void
DRCEFunctionalObjectBase::setLoggable
(
Loggable
loggable)
38
{
39
logger
.
setLoggable
(loggable);
40
}
41
//-----------------------------------------------------------------------------
42
void
DRCEFunctionalObjectBase::resetLoggable
(
void
)
43
{
44
logger
.
resetLoggable
();
45
}
46
//-----------------------------------------------------------------------------
47
//-----------------------------------------------------------------------------
48
bool
DRCEFunctionalObjectBase::insensitiveCompare
(
const
std::string& lhs,
const
std::string& rhs)
49
{
50
std::string lhsCpy(lhs);
51
std::string rhsCpy(rhs);
52
std::transform(lhsCpy.begin(), lhsCpy.end(), lhsCpy.begin(), tolower);
53
std::transform(rhsCpy.begin(), rhsCpy.end(), rhsCpy.begin(), tolower);
54
return
(lhsCpy == rhsCpy);
55
}
56
//-------------------------------------------------------------------
57
size_t
DRCEFunctionalObjectBase::getElapsedTimeMsec
(
const
Poco::Timestamp& tsStart)
58
{
59
Poco::Timestamp tsStop;
60
Poco::Timestamp::TimeDiff diff = tsStop-tsStart;
61
return
static_cast<
size_t
>
(diff/1000);
62
}
63
//-----------------------------------------------------------------------------
64
//-----------------------------------------------------------------------------
65
}
// namespace drce
66
}
// namespace HCE
sources
DRCE
src
DRCEFunctionalObjectBase.cpp
Generated on Mon Jan 13 2014 13:08:36 for HCE project C++ developers source code library by
1.8.1.2