ConsoleReporting.cpp
Go to the documentation of this file.
1 
2 #include "ConsoleReporting.hpp"
3 #include <rtt/Logger.hpp>
4 #include "TableMarshaller.hpp"
6 
7 #include "ocl/Component.hpp"
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 
22  {
23  RTT::Logger::In in("ConsoleReporting::startup");
24  if (mconsole) {
27  if ( this->writeHeader)
29  else
30  fheader = 0;
32 
33  this->addMarshaller( fheader, fbody );
34  } else {
35  log(Error) << "Could not write to console for reporting."<<RTT::endlog();
36  }
37 
39  }
40 
42  {
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 
bool addMarshaller(RTT::marsh::MarshallInterface *headerM, RTT::marsh::MarshallInterface *bodyM)
RTT::Property< bool > writeHeader
bool screenComponent(const std::string &comp)
Error
bool screenImpl(const std::string &comp, std::ostream &output)
A Component for periodically reporting Component Port contents to a human readable text format...
ORO_LIST_COMPONENT_TYPE(OCL::logging::Appender)
static Logger::LogFunction endlog()


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27