A Component for periodically reporting Component Port contents to a human readable text format. The default format is a table with a header. More...
#include <ReportingComponent.hpp>
Public Types | |
typedef RTT::DataFlowInterface::Ports | Ports |
typedef RTT::DataFlowInterface::Ports | Ports |
Public Member Functions | |
bool | addMarshaller (RTT::marsh::MarshallInterface *headerM, RTT::marsh::MarshallInterface *bodyM) |
bool | addMarshaller (RTT::marsh::MarshallInterface *headerM, RTT::marsh::MarshallInterface *bodyM) |
bool | removeMarshallers () |
bool | removeMarshallers () |
ReportingComponent (std::string name="Reporting") | |
ReportingComponent (std::string name="Reporting") | |
virtual | ~ReportingComponent () |
virtual | ~ReportingComponent () |
Script Methods | |
void | cleanReport () |
void | cleanReport () |
virtual void | cleanupHook () |
virtual void | cleanupHook () |
virtual bool | configureHook () |
virtual bool | configureHook () |
bool | copydata () |
bool | copydata () |
bool | reportComponent (const std::string &component) |
bool | reportComponent (const std::string &component) |
bool | reportData (const std::string &component, const std::string &dataname) |
bool | reportData (const std::string &component, const std::string &dataname) |
bool | reportPort (const std::string &component, const std::string &port) |
bool | reportPort (const std::string &component, const std::string &port) |
virtual bool | screenComponent (const std::string &comp) |
virtual bool | screenComponent (const std::string &comp) |
void | snapshot () |
void | snapshot () |
bool | unreportComponent (const std::string &component) |
bool | unreportComponent (const std::string &component) |
bool | unreportData (const std::string &component, const std::string &datasource) |
bool | unreportData (const std::string &component, const std::string &datasource) |
bool | unreportPort (const std::string &component, const std::string &port) |
bool | unreportPort (const std::string &component, const std::string &port) |
Protected Types | |
typedef boost::tuple < std::string, RTT::base::DataSourceBase::shared_ptr, boost::shared_ptr < RTT::base::ActionInterface > , RTT::base::DataSourceBase::shared_ptr, std::string, bool, bool > | DTupple |
typedef boost::tuple < std::string, RTT::base::DataSourceBase::shared_ptr, boost::shared_ptr < RTT::base::ActionInterface > , RTT::base::DataSourceBase::shared_ptr, std::string, bool, bool > | DTupple |
typedef std::vector< std::pair < boost::shared_ptr < RTT::marsh::MarshallInterface > , boost::shared_ptr < RTT::marsh::MarshallInterface > > > | Marshallers |
typedef std::vector< std::pair < boost::shared_ptr < RTT::marsh::MarshallInterface > , boost::shared_ptr < RTT::marsh::MarshallInterface > > > | Marshallers |
typedef std::vector< DTupple > | Reports |
typedef std::vector< DTupple > | Reports |
Protected Member Functions | |
void | makeReport () |
void | makeReport () |
bool | reportDataSource (std::string tag, std::string type, RTT::base::DataSourceBase::shared_ptr origm, bool) |
bool | reportDataSource (std::string tag, std::string type, RTT::base::DataSourceBase::shared_ptr origm, bool) |
bool | screenImpl (const std::string &comp, std::ostream &output) |
bool | screenImpl (const std::string &comp, std::ostream &output) |
virtual bool | startHook () |
virtual bool | startHook () |
virtual void | stopHook () |
virtual void | stopHook () |
bool | unreportDataSource (std::string tag) |
bool | unreportDataSource (std::string tag) |
virtual void | updateHook () |
virtual void | updateHook () |
Protected Attributes | |
RTT::Property< std::string > | config |
RTT::Property< bool > | decompose |
Marshallers | marshallers |
RTT::Property< std::string > | null |
RTT::PropertyBag | report |
RTT::Property< PropertyBag > | report_data |
Reports | root |
RTT::Property< bool > | snapshotOnly |
RTT::os::TimeService::ticks | starttime |
RTT::Property< bool > | synchronize_with_logging |
RTT::Property < RTT::os::TimeService::Seconds > | timestamp |
RTT::Property< bool > | writeHeader |
A Component for periodically reporting Component Port contents to a human readable text format. The default format is a table with a header.
It can report to any data format, using the 'addMarshaller' function, which is typically done in sub classes of this component.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "cpf.dtd"> <properties> <!-- ... other component properties .. --> <struct name="ReportData" type="PropertyBag"> <!-- Monitor all ports of a Component : --> <simple name="Component" type="string"><description></description><value>ComponentX</value></simple> <!-- Monitor a single Data or base::Buffer-Port of another Component : --> <simple name="Port" type="string"><description></description><value>ComponentY.PortZ</value></simple> <!-- add as many lines as desired... --> </struct> </properties>
Definition at line 81 of file install/include/orocos/ocl/ReportingComponent.hpp.
typedef boost::tuple<std::string, RTT::base::DataSourceBase::shared_ptr, boost::shared_ptr<RTT::base::ActionInterface>, RTT::base::DataSourceBase::shared_ptr, std::string,bool,bool> OCL::ReportingComponent::DTupple [protected] |
tuple that describes each sample. Uses get<N>() to read it: The qualified name of the data (componentname.portname) The data source of the data. Always returns the last value. A copy command to copy from this data source to another one The target data source for the copy operation The type of the data, "Data" (props and attrs) or "Port". 'newdata': The new data flag. Flags if the DataSource contains new data. 'tracked': True if this source may lead to additional data. If false, the source in itself will not cause to a re-scan. Used in copydata() to allow ports to be rescanned, while props and attrs never cause this (they always have newdata, but this is ignored).
Definition at line 206 of file reporting/ReportingComponent.hpp.
typedef boost::tuple<std::string, RTT::base::DataSourceBase::shared_ptr, boost::shared_ptr<RTT::base::ActionInterface>, RTT::base::DataSourceBase::shared_ptr, std::string,bool,bool> OCL::ReportingComponent::DTupple [protected] |
tuple that describes each sample. Uses get<N>() to read it: The qualified name of the data (componentname.portname) The data source of the data. Always returns the last value. A copy command to copy from this data source to another one The target data source for the copy operation The type of the data, "Data" (props and attrs) or "Port". 'newdata': The new data flag. Flags if the DataSource contains new data. 'tracked': True if this source may lead to additional data. If false, the source in itself will not cause to a re-scan. Used in copydata() to allow ports to be rescanned, while props and attrs never cause this (they always have newdata, but this is ignored).
Definition at line 206 of file install/include/orocos/ocl/ReportingComponent.hpp.
typedef std::vector< std::pair<boost::shared_ptr<RTT::marsh::MarshallInterface>, boost::shared_ptr<RTT::marsh::MarshallInterface> > > OCL::ReportingComponent::Marshallers [protected] |
Definition at line 228 of file reporting/ReportingComponent.hpp.
typedef std::vector< std::pair<boost::shared_ptr<RTT::marsh::MarshallInterface>, boost::shared_ptr<RTT::marsh::MarshallInterface> > > OCL::ReportingComponent::Marshallers [protected] |
Definition at line 228 of file install/include/orocos/ocl/ReportingComponent.hpp.
typedef RTT::DataFlowInterface::Ports OCL::ReportingComponent::Ports |
Definition at line 91 of file reporting/ReportingComponent.hpp.
typedef RTT::DataFlowInterface::Ports OCL::ReportingComponent::Ports |
Definition at line 91 of file install/include/orocos/ocl/ReportingComponent.hpp.
typedef std::vector<DTupple> OCL::ReportingComponent::Reports [protected] |
Stores the 'datasource' of all reported items as properties.
Definition at line 210 of file reporting/ReportingComponent.hpp.
typedef std::vector<DTupple> OCL::ReportingComponent::Reports [protected] |
Stores the 'datasource' of all reported items as properties.
Definition at line 210 of file install/include/orocos/ocl/ReportingComponent.hpp.
OCL::ReportingComponent::ReportingComponent | ( | std::string | name = "Reporting" |
) |
Set up a component for reporting.
Definition at line 38 of file ReportingComponent.cpp.
OCL::ReportingComponent::~ReportingComponent | ( | ) | [virtual] |
Definition at line 71 of file ReportingComponent.cpp.
OCL::ReportingComponent::ReportingComponent | ( | std::string | name = "Reporting" |
) |
Set up a component for reporting.
virtual OCL::ReportingComponent::~ReportingComponent | ( | ) | [virtual] |
bool OCL::ReportingComponent::addMarshaller | ( | RTT::marsh::MarshallInterface * | headerM, | |
RTT::marsh::MarshallInterface * | bodyM | |||
) |
Adds a Plugin to receive incomming data. The marshallers become owned by this component.
header | A marshaller which writes out a header when this component is started. May be null (0). | |
body | A marshaller wich will get periodically a serialisation request to process incomming data. May be null(0). |
example: addMarshaller( new HeaderMarshaller(), new ContentsMarshaller() );
bool OCL::ReportingComponent::addMarshaller | ( | RTT::marsh::MarshallInterface * | headerM, | |
RTT::marsh::MarshallInterface * | bodyM | |||
) |
Adds a Plugin to receive incomming data. The marshallers become owned by this component.
header | A marshaller which writes out a header when this component is started. May be null (0). | |
body | A marshaller wich will get periodically a serialisation request to process incomming data. May be null(0). |
example: addMarshaller( new HeaderMarshaller(), new ContentsMarshaller() );
void OCL::ReportingComponent::cleanReport | ( | ) |
void OCL::ReportingComponent::cleanReport | ( | ) |
Definition at line 510 of file ReportingComponent.cpp.
virtual void OCL::ReportingComponent::cleanupHook | ( | ) | [virtual] |
Implementation of base::TaskCore::cleanupHook(). Calls store() and clears the reporting configuration.
void OCL::ReportingComponent::cleanupHook | ( | ) | [virtual] |
Implementation of base::TaskCore::cleanupHook(). Calls store() and clears the reporting configuration.
Definition at line 95 of file ReportingComponent.cpp.
virtual bool OCL::ReportingComponent::configureHook | ( | ) | [virtual] |
Implementation of base::TaskCore::configureHook(). Calls load().
Reimplemented in OCL::TcpReporting, and OCL::TcpReporting.
bool OCL::ReportingComponent::configureHook | ( | ) | [virtual] |
Implementation of base::TaskCore::configureHook(). Calls load().
Reimplemented in OCL::TcpReporting, and OCL::TcpReporting.
Definition at line 101 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::copydata | ( | ) |
This real-time function makes copies of the data to be reported.
bool OCL::ReportingComponent::copydata | ( | ) |
This real-time function makes copies of the data to be reported.
Definition at line 455 of file ReportingComponent.cpp.
void OCL::ReportingComponent::makeReport | ( | ) | [protected] |
void OCL::ReportingComponent::makeReport | ( | ) | [protected] |
Definition at line 476 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::removeMarshallers | ( | ) |
Remove and delete all added Marshallers.
bool OCL::ReportingComponent::removeMarshallers | ( | ) |
Remove and delete all added Marshallers.
Definition at line 89 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::reportComponent | ( | const std::string & | component | ) |
Report all the data ports of a component.
bool OCL::ReportingComponent::reportComponent | ( | const std::string & | component | ) |
Report all the data ports of a component.
Definition at line 202 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::reportData | ( | const std::string & | component, | |
const std::string & | dataname | |||
) |
Report a specific data source of a component.
bool OCL::ReportingComponent::reportData | ( | const std::string & | component, | |
const std::string & | dataname | |||
) |
Report a specific data source of a component.
Definition at line 327 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::reportDataSource | ( | std::string | tag, | |
std::string | type, | |||
RTT::base::DataSourceBase::shared_ptr | origm, | |||
bool | ||||
) | [protected] |
bool OCL::ReportingComponent::reportDataSource | ( | std::string | tag, | |
std::string | type, | |||
RTT::base::DataSourceBase::shared_ptr | origm, | |||
bool | ||||
) | [protected] |
bool OCL::ReportingComponent::reportPort | ( | const std::string & | component, | |
const std::string & | port | |||
) |
Report a specific data port of a component.
bool OCL::ReportingComponent::reportPort | ( | const std::string & | component, | |
const std::string & | port | |||
) |
Report a specific data port of a component.
Definition at line 240 of file ReportingComponent.cpp.
virtual bool OCL::ReportingComponent::screenComponent | ( | const std::string & | comp | ) | [virtual] |
Write state information of a component. This method must be overridden by a subclass to be useful.
Reimplemented in OCL::ConsoleReporting, OCL::FileReporting, OCL::ConsoleReporting, and OCL::FileReporting.
bool OCL::ReportingComponent::screenComponent | ( | const std::string & | comp | ) | [virtual] |
Write state information of a component. This method must be overridden by a subclass to be useful.
Reimplemented in OCL::ConsoleReporting, OCL::FileReporting, OCL::ConsoleReporting, and OCL::FileReporting.
Definition at line 159 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::screenImpl | ( | const std::string & | comp, | |
std::ostream & | output | |||
) | [protected] |
This method writes out the status of a component's interface.
bool OCL::ReportingComponent::screenImpl | ( | const std::string & | comp, | |
std::ostream & | output | |||
) | [protected] |
This method writes out the status of a component's interface.
Definition at line 166 of file ReportingComponent.cpp.
void OCL::ReportingComponent::snapshot | ( | ) |
Copy the reported data and trigger the generation of a sampling line.
void OCL::ReportingComponent::snapshot | ( | ) |
Copy the reported data and trigger the generation of a sampling line.
Definition at line 443 of file ReportingComponent.cpp.
virtual bool OCL::ReportingComponent::startHook | ( | ) | [protected, virtual] |
Reimplemented in OCL::ConsoleReporting, OCL::FileReporting, OCL::TcpReporting, OCL::ConsoleReporting, OCL::FileReporting, OCL::NetcdfReporting, and OCL::TcpReporting.
bool OCL::ReportingComponent::startHook | ( | ) | [protected, virtual] |
Reimplemented in OCL::ConsoleReporting, OCL::FileReporting, OCL::TcpReporting, OCL::ConsoleReporting, OCL::FileReporting, OCL::NetcdfReporting, and OCL::TcpReporting.
Definition at line 401 of file ReportingComponent.cpp.
virtual void OCL::ReportingComponent::stopHook | ( | ) | [protected, virtual] |
Reimplemented in OCL::ConsoleReporting, OCL::FileReporting, OCL::TcpReporting, OCL::ConsoleReporting, OCL::FileReporting, OCL::NetcdfReporting, and OCL::TcpReporting.
void OCL::ReportingComponent::stopHook | ( | ) | [protected, virtual] |
Reimplemented in OCL::ConsoleReporting, OCL::FileReporting, OCL::TcpReporting, OCL::ConsoleReporting, OCL::FileReporting, OCL::NetcdfReporting, and OCL::TcpReporting.
Definition at line 540 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportComponent | ( | const std::string & | component | ) |
Unreport the data ports of a component.
bool OCL::ReportingComponent::unreportComponent | ( | const std::string & | component | ) |
Unreport the data ports of a component.
Definition at line 222 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportData | ( | const std::string & | component, | |
const std::string & | datasource | |||
) |
Unreport a specific data source of a component.
bool OCL::ReportingComponent::unreportData | ( | const std::string & | component, | |
const std::string & | datasource | |||
) |
Unreport a specific data source of a component.
Definition at line 359 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportDataSource | ( | std::string | tag | ) | [protected] |
bool OCL::ReportingComponent::unreportDataSource | ( | std::string | tag | ) | [protected] |
Definition at line 390 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportPort | ( | const std::string & | component, | |
const std::string & | port | |||
) |
Unreport a specific data port of a component.
bool OCL::ReportingComponent::unreportPort | ( | const std::string & | component, | |
const std::string & | port | |||
) |
Unreport a specific data port of a component.
Definition at line 316 of file ReportingComponent.cpp.
virtual void OCL::ReportingComponent::updateHook | ( | ) | [protected, virtual] |
This not real-time function processes the copied data.
void OCL::ReportingComponent::updateHook | ( | ) | [protected, virtual] |
This not real-time function processes the copied data.
Definition at line 516 of file ReportingComponent.cpp.
RTT::Property< std::string > OCL::ReportingComponent::config [protected] |
Definition at line 233 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< bool > OCL::ReportingComponent::decompose [protected] |
Definition at line 235 of file install/include/orocos/ocl/ReportingComponent.hpp.
Marshallers OCL::ReportingComponent::marshallers [protected] |
Definition at line 229 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< std::string > OCL::ReportingComponent::null [protected] |
Definition at line 238 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::PropertyBag OCL::ReportingComponent::report [protected] |
Definition at line 230 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< PropertyBag > OCL::ReportingComponent::report_data [protected] |
Definition at line 237 of file install/include/orocos/ocl/ReportingComponent.hpp.
Reports OCL::ReportingComponent::root [protected] |
Definition at line 211 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< bool > OCL::ReportingComponent::snapshotOnly [protected] |
Definition at line 232 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::os::TimeService::ticks OCL::ReportingComponent::starttime [protected] |
Definition at line 240 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< bool > OCL::ReportingComponent::synchronize_with_logging [protected] |
Definition at line 236 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< RTT::os::TimeService::Seconds > OCL::ReportingComponent::timestamp [protected] |
Definition at line 241 of file install/include/orocos/ocl/ReportingComponent.hpp.
RTT::Property< bool > OCL::ReportingComponent::writeHeader [protected] |
Definition at line 234 of file install/include/orocos/ocl/ReportingComponent.hpp.