ReportingComponent Class Reference

#include <ReportingComponent.hpp>

Inheritance diagram for ReportingComponent:

ConsoleReporting FileReporting NetcdfReporting TcpReporting

List of all members.


Detailed Description

A Component for periodically reporting Component DataObject contents to a human readable text format.

The default is a table with a header.

It can report to any data format, using the 'addMarshaller' function. If the user does not add any marshallers, the properties will be used to create default marshallers.

Configuration
The ReportingComponent (and its decendants) take two configuration files. The first is the 'classical' XML '.cpf' file which contains the property values of the ReportingComponent. For example, to enable writing a header or not. The second XML file is in the same format, but describes which ports and peer components need to be monitored. It has the following format:
     <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE properties SYSTEM "cpf.dtd">
     <properties>
       <!-- Monitor all ports of a Component : -->
       <simple name="Component" type="string"><description></description><value>ComponentX</value></simple>

       <!-- Monitor a single Data or Buffer-Port of another Component : -->
       <simple name="Port" type="string"><description></description><value>ComponentY.PortZ</value></simple>

       <!-- add as many lines as desired... -->

     </properties>
The above file is read by the 'ReportingComponentload()' method, the file to load is listed in the 'Configuration' property.

Definition at line 79 of file ReportingComponent.hpp.


Public Types

typedef
RTT::DataFlowInterface::Ports 
Ports

Public Member Functions

 ReportingComponent (std::string name="Reporting")
 Set up a component for reporting.
bool addMarshaller (RTT::Marshaller *headerM, RTT::Marshaller *bodyM)
 Adds a Plugin to receive incomming data.
bool removeMarshallers ()
 Remove and delete all added Marshallers.
Script Methods
virtual bool configureHook ()
 Implementation of TaskCore::configureHook().
virtual void cleanupHook ()
 Implementation of TaskCore::cleanupHook().
bool load ()
 Read the configuration file in order to decide on what to report.
bool store ()
 Write the configuration file describing what is being reported.
virtual bool screenComponent (const std::string &comp)
 Write state information of a component.
bool reportComponent (const std::string &component)
 Report all the data ports of a component.
bool unreportComponent (const std::string &component)
 Unreport the data ports of a component.
bool reportPort (const std::string &component, const std::string &port)
 Report a specific data port of a component.
bool unreportPort (const std::string &component, const std::string &port)
 Unreport a specific data port of a component.
bool reportData (const std::string &component, const std::string &dataname)
 Report a specific data source of a component.
bool unreportData (const std::string &component, const std::string &datasource)
 Unreport a specific data source of a component.
void snapshot ()
 This real-time function makes copies of the data to be reported.
void cleanReport ()
 Implementation of TaskCore::configureHook().

Protected Types

typedef boost::tuple
< std::string,
RTT::DataSourceBase::shared_ptr,
boost::shared_ptr
< RTT::CommandInterface >
, RTT::DataSourceBase::shared_ptr,
std::string > 
DTupple
typedef std::vector< DTupple > Reports
 Stores the 'datasource' of all reported items as properties.
typedef std::vector< std::pair
< boost::shared_ptr
< RTT::Marshaller >
, boost::shared_ptr
< RTT::Marshaller > > > 
Marshallers

Protected Member Functions

bool screenImpl (const std::string &comp, std::ostream &output)
 This method writes out the status of a component's interface.
bool reportDataSource (std::string tag, std::string type, RTT::DataSourceBase::shared_ptr orig)
bool unreportDataSource (std::string tag)
virtual bool startHook ()
void makeReport ()
virtual void updateHook ()
 This not real-time function processes the copied data.
virtual void stopHook ()

Protected Attributes

Reports root
Marshallers marshallers
RTT::PropertyBag report
RTT::Property< bool > autotrigger
RTT::Property< std::string > config
RTT::Property< bool > writeHeader
RTT::Property< bool > decompose
RTT::TimeService::ticks starttime
RTT::Property
< RTT::TimeService::Seconds > 
timestamp

Member Function Documentation

bool addMarshaller ( RTT::Marshaller *  headerM,
RTT::Marshaller *  bodyM 
)

Adds a Plugin to receive incomming data.

The marshallers become owned by this component.

Parameters:
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() );

Referenced by NetcdfReporting::startHook().

bool configureHook (  )  [virtual]

Implementation of TaskCore::configureHook().

Calls load().

Reimplemented in TcpReporting.

Definition at line 148 of file ReportingComponent.cpp.

References ReportingComponent::load().

void cleanupHook (  )  [virtual]

Implementation of TaskCore::cleanupHook().

Calls store() and clears the reporting configuration.

Definition at line 153 of file ReportingComponent.cpp.

References ReportingComponent::store().

bool 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 ConsoleReporting, and FileReporting.

Definition at line 203 of file ReportingComponent.cpp.

Referenced by ReportingComponent::ReportingComponent().

void cleanReport (  ) 

Implementation of TaskCore::configureHook().

Calls load().

Definition at line 418 of file ReportingComponent.cpp.

Referenced by ReportingComponent::updateHook().


The documentation for this class was generated from the following files:

Generated on Wed Dec 24 11:20:41 2008 for OrocosComponentLibrary by  doxygen 1.5.6