TcpReporting Class Reference

A component which writes data reports to a tcp/ip socket. More...

#include <TcpReporting.hpp>

Inheritance diagram for TcpReporting:
ReportingComponent

List of all members.

Public Types

typedef
RTT::DataFlowInterface::Ports 
Ports

Public Member Functions

 TcpReporting (std::string fr_name="ReportingComponent")
 Create a reporting component which starts up a server.
bool configureHook ()
 Implementation of TaskCore::configureHook().
bool startHook ()
void stopHook ()
const RTT::PropertyBag * getReport ()
 Return a property bag.
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 void cleanupHook ()
 Implementation of TaskCore::cleanupHook().
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)
void makeReport ()
virtual void updateHook ()
 This not real-time function processes the copied data.

Protected Attributes

RTT::SocketMarshallerfbody
 Marshaller.
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::Property< bool > synchronize_with_logging
RTT::Property< PropertyBag > report_data
RTT::TimeService::ticks starttime
RTT::Property
< RTT::TimeService::Seconds > 
timestamp

Detailed Description

A component which writes data reports to a tcp/ip socket.

It can serve different clients. It uses a ASCI-based protocol.

Usage

Authentication of the client:

The server accepts different kinds of commands. Before these commands are available for the client, the client has to authenticate itself.

Getting Help:

The client can get the available commands

and the syntax for each command.

Getting a list of available data:

The client can get the names of all the available data.

Subscribe to Data:

The client has to send the server the names of the available data he wants to get. Only the subscribed data will be send to the client.

Unsubscribe to Data:

The client can cancel a subscription.

Getting a list of the subscriptions:

The client can ask for the subscriptions he has made.

Start/stop streaming the data:

The client can start and stop the streaming of the subscribed data.

Close the connection with the server:

The client can close the connection with the server.

When an error occures:

When an error occurs because of wrong syntax the server will answer with an error message.

The streaming data:

When the streaming is started the server will send the following message at each timeframe.

Definition at line 170 of file TcpReporting.hpp.


Constructor & Destructor Documentation

TcpReporting ( std::string  fr_name = "ReportingComponent"  ) 

Create a reporting component which starts up a server.

Parameters:
fr_name Name of the TCP reporting component.
port Port to listen on.

Definition at line 214 of file TcpReporting.cpp.


Member Function Documentation

bool addMarshaller ( RTT::Marshaller *  headerM,
RTT::Marshaller *  bodyM 
) [inherited]

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 ConsoleReporting::ConsoleReporting().

void cleanReport (  )  [inherited]

Implementation of TaskCore::configureHook().

Calls load().

Definition at line 427 of file ReportingComponent.cpp.

Referenced by ReportingComponent::updateHook().

void cleanupHook (  )  [virtual, inherited]

Implementation of TaskCore::cleanupHook().

Calls store() and clears the reporting configuration.

Definition at line 126 of file ReportingComponent.cpp.

bool configureHook (  )  [virtual]

Implementation of TaskCore::configureHook().

Calls load().

Reimplemented from ReportingComponent.

Definition at line 232 of file TcpReporting.cpp.

bool screenComponent ( const std::string &  comp  )  [virtual, inherited]

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 175 of file ReportingComponent.cpp.

Referenced by ReportingComponent::ReportingComponent().


The documentation for this class was generated from the following files:
Generated on Thu Dec 23 15:05:29 2010 for OrocosComponentLibrary by  doxygen 1.6.3