Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
reporting
ConsoleReporting.cpp
Go to the documentation of this file.
1
2
#include "
ConsoleReporting.hpp
"
3
#include <
rtt/Logger.hpp
>
4
#include "
TableMarshaller.hpp
"
5
#include "
NiceHeaderMarshaller.hpp
"
6
7
#include "
ocl/Component.hpp
"
8
ORO_LIST_COMPONENT_TYPE
(
OCL::ConsoleReporting
)
9
10
namespace
OCL
11
{
12
using namespace
RTT
;
13
using namespace
std
;
14
15
ConsoleReporting::ConsoleReporting(std::string fr_name
/*= "Reporting"*/
, std::ostream& console
/*= std::cerr*/
)
16
:
ReportingComponent
( fr_name ),
17
mconsole( console )
18
{
19
}
20
21
bool
ConsoleReporting::startHook
()
22
{
23
RTT::Logger::In
in(
"ConsoleReporting::startup"
);
24
if
(
mconsole
) {
25
RTT::marsh::MarshallInterface
* fheader;
26
RTT::marsh::MarshallInterface
* fbody;
27
if
( this->
writeHeader
)
28
fheader =
new
RTT::NiceHeaderMarshaller<std::ostream>
(
mconsole
);
29
else
30
fheader = 0;
31
fbody =
new
RTT::TableMarshaller<std::ostream>
(
mconsole
);
32
33
this->
addMarshaller
( fheader, fbody );
34
}
else
{
35
log(
Error
) <<
"Could not write to console for reporting."
<<
RTT::endlog
();
36
}
37
38
return
ReportingComponent::startHook
();
39
}
40
41
void
ConsoleReporting::stopHook
()
42
{
43
ReportingComponent::stopHook
();
44
45
this->
removeMarshallers
();
46
}
47
48
bool
ConsoleReporting::screenComponent
(
const
std::string& comp)
49
{
50
if
( !
mconsole
)
51
return
false
;
52
return
this->
screenImpl
( comp,
mconsole
);
53
}
54
}
55
OCL::ReportingComponent::addMarshaller
bool addMarshaller(RTT::marsh::MarshallInterface *headerM, RTT::marsh::MarshallInterface *bodyM)
Definition:
ReportingComponent.cpp:222
OCL::ReportingComponent::startHook
virtual bool startHook()
Definition:
ReportingComponent.cpp:547
RTT::marsh::MarshallInterface
NiceHeaderMarshaller.hpp
OCL::ConsoleReporting::startHook
bool startHook()
Definition:
ConsoleReporting.cpp:21
OCL::ConsoleReporting
Definition:
ConsoleReporting.hpp:14
OCL::ReportingComponent::writeHeader
RTT::Property< bool > writeHeader
Definition:
ReportingComponent.hpp:239
std
ConsoleReporting.hpp
OCL::ConsoleReporting::mconsole
std::ostream & mconsole
Definition:
ConsoleReporting.hpp:21
OCL::ConsoleReporting::screenComponent
bool screenComponent(const std::string &comp)
Definition:
ConsoleReporting.cpp:48
Logger.hpp
Component.hpp
OCL::ReportingComponent::removeMarshallers
bool removeMarshallers()
Definition:
ReportingComponent.cpp:237
OCL::ReportingComponent::stopHook
virtual void stopHook()
Definition:
ReportingComponent.cpp:698
OCL
Definition:
deployer-funcs.cpp:68
OCL::ConsoleReporting::stopHook
void stopHook()
Definition:
ConsoleReporting.cpp:41
RTT::NiceHeaderMarshaller
Definition:
NiceHeaderMarshaller.hpp:55
Error
Error
OCL::ReportingComponent::screenImpl
bool screenImpl(const std::string &comp, std::ostream &output)
Definition:
ReportingComponent.cpp:314
OCL::ReportingComponent
A Component for periodically reporting Component Port contents to a human readable text format...
Definition:
ReportingComponent.hpp:81
RTT::TableMarshaller
Definition:
TableMarshaller.hpp:56
ORO_LIST_COMPONENT_TYPE
ORO_LIST_COMPONENT_TYPE(OCL::logging::GenerationalFileAppender)
RTT::Logger::In
RTT
RTT::endlog
static Logger::LogFunction endlog()
TableMarshaller.hpp
ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19