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 |
Public Types inherited from RTT::TaskContext | |
typedef std::vector< std::string > | PeerList |
typedef boost::function< void(base::PortInterface *)> | SlotFunction |
Public Types inherited from RTT::base::TaskCore | |
enum | TaskState |
Public Member Functions | |
bool | addMarshaller (RTT::marsh::MarshallInterface *headerM, RTT::marsh::MarshallInterface *bodyM) |
bool | removeMarshallers () |
ReportingComponent (std::string name="Reporting") | |
virtual | ~ReportingComponent () |
Script Methods | |
virtual bool | configureHook () |
virtual void | cleanupHook () |
virtual bool | screenComponent (const std::string &comp) |
bool | reportComponent (const std::string &component) |
bool | unreportComponent (const std::string &component) |
bool | reportPort (const std::string &component, const std::string &port) |
bool | unreportPort (const std::string &component, const std::string &port) |
bool | reportData (const std::string &component, const std::string &dataname) |
bool | unreportData (const std::string &component, const std::string &datasource) |
bool | copydata () |
void | snapshot () |
void | cleanReport () |
Public Member Functions inherited from RTT::TaskContext | |
bool | addAttribute (const std::string &name, T &attr) |
bool | addAttribute (base::AttributeBase &a) |
bool | addAttribute (base::AttributeBase &a) |
bool | addAttribute (const std::string &name, T &attr) |
bool | addConstant (const std::string &name, const T &attr) |
bool | addConstant (const std::string &name, const T &attr) |
base::InputPortInterface & | addEventPort (const std::string &name, base::InputPortInterface &port, SlotFunction callback=SlotFunction()) |
base::InputPortInterface & | addEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction()) |
Operation< Signature > & | addOperation (Operation< Signature > &op) |
Operation< Signature > & | addOperation (Operation< Signature > &op) |
Operation< typename internal::GetSignature< Func >::Signature > & | addOperation (const std::string name, Func func, Service *serv, ExecutionThread et=ClientThread) |
Operation< Signature > & | addOperation (const std::string name, Signature *func, ExecutionThread et=ClientThread) |
Operation< typename internal::GetSignature< Func >::Signature > & | addOperation (const std::string name, Func func, Service *serv, ExecutionThread et=ClientThread) |
Operation< Signature > & | addOperation (const std::string name, Signature *func, ExecutionThread et=ClientThread) |
virtual bool | addPeer (TaskContext *peer, std::string alias="") |
virtual bool | addPeer (TaskContext *peer, std::string alias="") |
base::PortInterface & | addPort (const std::string &name, base::PortInterface &port) |
base::PortInterface & | addPort (base::PortInterface &port) |
Property< T > & | addProperty (const std::string &name, T &attr) |
bool | addProperty (base::PropertyBase &pb) |
Property< T > & | addProperty (const std::string &name, T &attr) |
bool | addProperty (base::PropertyBase &pb) |
ConfigurationInterface * | attributes () |
ConfigurationInterface * | attributes () |
virtual void | clear () |
virtual bool | connectPeers (TaskContext *peer) |
virtual bool | connectPeers (TaskContext *peer) |
virtual bool | connectPorts (TaskContext *peer) |
virtual bool | connectServices (TaskContext *peer) |
virtual bool | connectServices (TaskContext *peer) |
virtual void | disconnect () |
virtual void | disconnect () |
virtual void | disconnectPeers (const std::string &name) |
virtual void | disconnectPeers (const std::string &name) |
base::ActivityInterface * | getActivity () |
T * | getActivity () |
base::AttributeBase * | getAttribute (const std::string &name) const |
base::AttributeBase * | getAttribute (const std::string &name) const |
virtual const std::string & | getName () const |
OperationInterfacePart * | getOperation (std::string name) |
OperationInterfacePart * | getOperation (std::string name) |
virtual TaskContext * | getPeer (const std::string &peer_name) const |
virtual TaskContext * | getPeer (const std::string &peer_name) const |
virtual PeerList | getPeerList () const |
virtual PeerList | getPeerList () const |
base::PortInterface * | getPort (const std::string &name) const |
base::PropertyBase * | getProperty (const std::string &name) const |
base::PropertyBase * | getProperty (const std::string &name) const |
boost::shared_ptr< ServiceType > | getProvider (const std::string &name) |
boost::shared_ptr< ServiceType > | getProvider (const std::string &name) |
virtual bool | hasPeer (const std::string &peer_name) const |
virtual bool | hasPeer (const std::string &peer_name) const |
bool | loadService (const std::string &service_name) |
bool | loadService (const std::string &service_name) |
OperationInterface * | operations () |
OperationInterface * | operations () |
DataFlowInterface * | ports () |
const DataFlowInterface * | ports () const |
PropertyBag * | properties () |
PropertyBag * | properties () |
Service::shared_ptr | provides (const std::string &service_name) |
Service::shared_ptr | provides () |
Service::shared_ptr | provides () |
Service::shared_ptr | provides (const std::string &service_name) |
virtual bool | ready () |
virtual void | removePeer (const std::string &name) |
virtual void | removePeer (TaskContext *peer) |
virtual void | removePeer (TaskContext *peer) |
virtual void | removePeer (const std::string &name) |
ServiceRequester::shared_ptr | requires (const std::string &service_name) |
ServiceRequester::shared_ptr | requires (const std::string &service_name) |
ServiceRequester::shared_ptr | requires () |
ServiceRequester::shared_ptr | requires () |
bool | setActivity (base::ActivityInterface *new_act) |
virtual bool | start () |
virtual bool | stop () |
TaskContext (const std::string &name, TaskState initial_state=Stopped) | |
virtual | ~TaskContext () |
Public Member Functions inherited from RTT::base::TaskCore | |
virtual bool | activate () |
virtual bool | activate () |
virtual bool | cleanup () |
virtual bool | cleanup () |
virtual bool | configure () |
virtual bool | configure () |
const ExecutionEngine * | engine () const |
ExecutionEngine * | engine () |
virtual void | error () |
virtual void | error () |
virtual unsigned | getCpuAffinity () const |
virtual unsigned | getCpuAffinity () const |
unsigned int | getCycleCounter () const |
unsigned int | getIOCounter () const |
virtual Seconds | getPeriod () const |
virtual Seconds | getPeriod () const |
virtual TaskState | getTargetState () const |
virtual TaskState | getTaskState () const |
unsigned int | getTimeOutCounter () const |
unsigned int | getTriggerCounter () const |
virtual bool | inException () const |
virtual bool | inException () const |
virtual bool | inFatalError () const |
virtual bool | inFatalError () const |
virtual bool | inRunTimeError () const |
virtual bool | inRunTimeError () const |
virtual bool | isActive () const |
virtual bool | isActive () const |
virtual bool | isConfigured () const |
virtual bool | isConfigured () const |
virtual bool | isRunning () const |
virtual bool | isRunning () const |
virtual bool | recover () |
virtual bool | recover () |
virtual bool | setCpuAffinity (unsigned cpu) |
virtual bool | setCpuAffinity (unsigned cpu) |
virtual bool | setPeriod (Seconds s) |
virtual bool | setPeriod (Seconds s) |
TaskCore (TaskState initial_state=Stopped, const std::string &name=std::string()) | |
virtual bool | trigger () |
virtual bool | trigger () |
virtual bool | update () |
virtual bool | update () |
virtual | ~TaskCore () |
Protected Types | |
typedef boost::tuple< std::string, RTT::base::DataSourceBase::shared_ptr, std::string, RTT::base::PropertyBase *, RTT::base::InputPortInterface *, bool, bool > | DTupple |
typedef std::vector< std::pair< boost::shared_ptr< RTT::marsh::MarshallInterface >, boost::shared_ptr< RTT::marsh::MarshallInterface > > > | Marshallers |
typedef std::vector< DTupple > | Reports |
enum | T_Types { T_QualName = 0, T_PortDS, T_DataType, T_Property, T_Port, T_NewData, T_Tracked } |
Use these to index DTupple objects. More... | |
Protected Member Functions | |
void | makeReport2 () |
bool | reportDataSource (std::string tag, std::string type, RTT::base::DataSourceBase::shared_ptr origm, RTT::base::InputPortInterface *ipi, bool) |
bool | screenImpl (const std::string &comp, std::ostream &output) |
virtual bool | startHook () |
virtual void | stopHook () |
bool | unreportDataSource (std::string tag) |
virtual void | updateHook () |
Protected Member Functions inherited from RTT::TaskContext | |
virtual void | dataOnPortCallback (base::PortInterface *port) |
virtual bool | dataOnPortHook (base::PortInterface *port) |
void | forceActivity (base::ActivityInterface *new_act) |
Protected Member Functions inherited from RTT::base::TaskCore | |
virtual bool | breakUpdateHook () |
virtual void | errorHook () |
virtual void | exception () |
virtual void | exceptionHook () |
virtual void | fatal () |
Protected Attributes | |
RTT::Property< bool > | complexdecompose |
RTT::Property< std::string > | config |
RTT::Property< bool > | decompose |
RTT::Property< bool > | insnapshot |
Marshallers | marshallers |
RTT::internal::DataSource< bool >::shared_ptr | mchecker |
If false, a sequence size has changed. More... | |
bool | onlyNewData |
RTT::PropertyBag | report |
RTT::Property< PropertyBag > | report_data |
RTT::ConnPolicy | report_policy |
Reports | root |
bool | snapshotted |
RTT::os::TimeService::ticks | starttime |
RTT::Property< bool > | synchronize_with_logging |
RTT::Property< RTT::os::TimeService::Seconds > | timestamp |
RTT::Property< bool > | writeHeader |
Protected Attributes inherited from RTT::base::TaskCore | |
ExecutionEngine * | ee |
unsigned int | mCycleCounter |
unsigned int | mIOCounter |
std::string | mName |
TaskState | mTaskState |
unsigned int | mTimeOutCounter |
unsigned int | mTriggerCounter |
bool | mTriggerOnStart |
Additional Inherited Members | |
Public Attributes inherited from RTT::base::TaskCore | |
Exception | |
FatalError | |
Init | |
PreOperational | |
Running | |
RunTimeError | |
Stopped | |
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.
Definition at line 81 of file ReportingComponent.hpp.
|
protected |
tuple that describes each sample. Uses get<N>() to read it: @0 The qualified name of the data (componentname.portname) @1 The data source of the data. Always returns the last value. @2 A copy command to copy from this data source to another one @3 The target data source for the copy operation @4 The type of the data, "Data" (props and attrs) or "Port". @5 'newdata': The new data flag. Flags if the DataSource contains new data. @6 '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 204 of file ReportingComponent.hpp.
|
protected |
Definition at line 229 of file ReportingComponent.hpp.
Definition at line 91 of file ReportingComponent.hpp.
|
protected |
Stores the 'datasource' of all reported items as properties.
Definition at line 211 of file ReportingComponent.hpp.
|
protected |
Use these to index DTupple objects.
Enumerator | |
---|---|
T_QualName | |
T_PortDS | |
T_DataType | |
T_Property | |
T_Port | |
T_NewData | |
T_Tracked |
Definition at line 207 of file ReportingComponent.hpp.
OCL::ReportingComponent::ReportingComponent | ( | std::string | name = "Reporting" | ) |
Set up a component for reporting.
Definition at line 177 of file ReportingComponent.cpp.
|
virtual |
Definition at line 215 of file ReportingComponent.cpp.
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() );
Definition at line 218 of file ReportingComponent.cpp.
void OCL::ReportingComponent::cleanReport | ( | ) |
Definition at line 650 of file ReportingComponent.cpp.
|
virtual |
Implementation of base::TaskCore::cleanupHook(). Calls store() and clears the reporting configuration.
Reimplemented from RTT::base::TaskCore.
Definition at line 239 of file ReportingComponent.cpp.
|
virtual |
Implementation of base::TaskCore::configureHook(). Calls load().
Reimplemented from RTT::base::TaskCore.
Reimplemented in OCL::TcpReporting.
Definition at line 245 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::copydata | ( | ) |
This real-time function makes copies of the data to be reported.
Definition at line 599 of file ReportingComponent.cpp.
|
protected |
Definition at line 613 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::removeMarshallers | ( | ) |
Remove and delete all added Marshallers.
Definition at line 233 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::reportComponent | ( | const std::string & | component | ) |
Report all the data ports of a component.
Definition at line 346 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::reportData | ( | const std::string & | component, |
const std::string & | dataname | ||
) |
Report a specific data source of a component.
Definition at line 475 of file ReportingComponent.cpp.
|
protected |
Definition at line 511 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::reportPort | ( | const std::string & | component, |
const std::string & | port | ||
) |
Report a specific data port of a component.
Definition at line 384 of file ReportingComponent.cpp.
|
virtual |
Write state information of a component. This method must be overridden by a subclass to be useful.
Reimplemented in OCL::FileReporting, and OCL::ConsoleReporting.
Definition at line 303 of file ReportingComponent.cpp.
|
protected |
This method writes out the status of a component's interface.
Definition at line 310 of file ReportingComponent.cpp.
void OCL::ReportingComponent::snapshot | ( | ) |
Copy the reported data and trigger the generation of a sampling line.
Definition at line 591 of file ReportingComponent.cpp.
|
protectedvirtual |
Reimplemented from RTT::base::TaskCore.
Reimplemented in OCL::TcpReporting, OCL::NetcdfReporting, OCL::FileReporting, and OCL::ConsoleReporting.
Definition at line 543 of file ReportingComponent.cpp.
|
protectedvirtual |
Reimplemented from RTT::base::TaskCore.
Reimplemented in OCL::TcpReporting, OCL::NetcdfReporting, OCL::FileReporting, and OCL::ConsoleReporting.
Definition at line 694 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportComponent | ( | const std::string & | component | ) |
Unreport the data ports of a component.
Definition at line 366 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportData | ( | const std::string & | component, |
const std::string & | datasource | ||
) |
Unreport a specific data source of a component.
Definition at line 507 of file ReportingComponent.cpp.
|
protected |
Definition at line 532 of file ReportingComponent.cpp.
bool OCL::ReportingComponent::unreportPort | ( | const std::string & | component, |
const std::string & | port | ||
) |
Unreport a specific data port of a component.
Definition at line 464 of file ReportingComponent.cpp.
|
protectedvirtual |
This not real-time function processes the copied data.
Reimplemented from RTT::base::TaskCore.
Definition at line 656 of file ReportingComponent.cpp.
|
protected |
Definition at line 241 of file ReportingComponent.hpp.
|
protected |
Definition at line 238 of file ReportingComponent.hpp.
|
protected |
Definition at line 240 of file ReportingComponent.hpp.
|
protected |
Definition at line 242 of file ReportingComponent.hpp.
|
protected |
Definition at line 230 of file ReportingComponent.hpp.
|
protected |
If false, a sequence size has changed.
Definition at line 251 of file ReportingComponent.hpp.
|
protected |
Definition at line 246 of file ReportingComponent.hpp.
|
protected |
Definition at line 231 of file ReportingComponent.hpp.
|
protected |
Definition at line 244 of file ReportingComponent.hpp.
|
protected |
Definition at line 245 of file ReportingComponent.hpp.
|
protected |
Definition at line 212 of file ReportingComponent.hpp.
|
protected |
Used to communicate between snapshot() and updateHook() if updateHook needs to make a copy.
Definition at line 237 of file ReportingComponent.hpp.
|
protected |
Definition at line 248 of file ReportingComponent.hpp.
|
protected |
Definition at line 243 of file ReportingComponent.hpp.
|
protected |
Definition at line 249 of file ReportingComponent.hpp.
|
protected |
Definition at line 239 of file ReportingComponent.hpp.