A component which writes data reports to a tcp/ip socket. It can serve different clients. It uses a ASCI-based protocol. More...
#include <TcpReporting.hpp>
Public Member Functions | |
bool | configureHook () |
const RTT::PropertyBag * | getReport () |
bool | startHook () |
void | stopHook () |
TcpReporting (std::string fr_name="ReportingComponent") | |
~TcpReporting () | |
Public Member Functions inherited from OCL::ReportingComponent | |
bool | addMarshaller (RTT::marsh::MarshallInterface *headerM, RTT::marsh::MarshallInterface *bodyM) |
bool | removeMarshallers () |
ReportingComponent (std::string name="Reporting") | |
virtual | ~ReportingComponent () |
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 Attributes | |
RTT::SocketMarshaller * | fbody |
Protected Attributes inherited from OCL::ReportingComponent | |
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 |
Private Attributes | |
bool | _finishing |
unsigned int | port |
RTT::Property< unsigned int > | port_prop |
Additional Inherited Members | |
Public Types inherited from OCL::ReportingComponent | |
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 Attributes inherited from RTT::base::TaskCore | |
Exception | |
FatalError | |
Init | |
PreOperational | |
Running | |
RunTimeError | |
Stopped | |
Protected Types inherited from OCL::ReportingComponent | |
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 inherited from OCL::ReportingComponent | |
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) |
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 () |
A component which writes data reports to a tcp/ip socket. It can serve different clients. It uses a ASCI-based protocol.
The server accepts different kinds of commands. Before these commands are available for the client, the client has to authenticate itself.
"VERSION 1.0\n"
"101 OK\n"
"106 not supported\n"
The client can get the available commands
"HELP\n"
"Use HELP <command>\n CommandName1\n CommandName2\n ... CommandNameN\n."
and the syntax for each command.
"HELP CommandName\n"
"Name: CommandName\n Usage: CommandName CommandSyntax\n"
The client can get the names of all the available data.
"HEADERS\n"
"305 DataName1\n 305 DataName2\n ... 305 DataNameN\n 306 End of list\n"
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.
"SUBSCRIBE DataNameX\n"
"302 DataNameX\n"
"301 DataNameX\n"
The client can cancel a subscription.
"UNSUBSCRIBE DataNameX\n"
"303 DataNameX\n"
"304 DataNameX\n"
The client can ask for the subscriptions he has made.
"SUBS\n"
"305 DataNameX1\n 305 DataNameX2\n ... 305 DataNameXN\n 306 End of list\n"
The client can start and stop the streaming of the subscribed data.
"SILENCE OFF\n"-To stop:
"SILENCE ON\n"
"107 SILENCE ON/OFF\n"
The client can close the connection with the server.
"QUIT\n"or
"EXIT\n"
"104 Bye Bye\n"
When an error occurs because of wrong syntax the server will answer with an error message.
"102 Syntax: CommandNameX CommandSyntaxX\n"
When the streaming is started the server will send the following message at each timeframe.
"201 framenr --- begin of frame\n 202 DataNameX1\n 205 DataValueX1\n 202 DataNameX2\n 205 DataValueX2\n ... 202 DataNameXN\n 205 DataValueXN\n 203 framenr --- end of frame\n"
Definition at line 170 of file TcpReporting.hpp.
OCL::TcpReporting::TcpReporting | ( | std::string | fr_name = "ReportingComponent" | ) |
Create a reporting component which starts up a server
fr_name | Name of the TCP reporting component. |
port | Port to listen on. |
Definition at line 214 of file TcpReporting.cpp.
OCL::TcpReporting::~TcpReporting | ( | ) |
Definition at line 222 of file TcpReporting.cpp.
|
virtual |
Implementation of base::TaskCore::configureHook(). Calls load().
Reimplemented from OCL::ReportingComponent.
Definition at line 232 of file TcpReporting.cpp.
const RTT::PropertyBag * OCL::TcpReporting::getReport | ( | ) |
Return a property bag.
Definition at line 226 of file TcpReporting.cpp.
|
virtual |
Reimplemented from OCL::ReportingComponent.
Definition at line 237 of file TcpReporting.cpp.
|
virtual |
Reimplemented from OCL::ReportingComponent.
Definition at line 246 of file TcpReporting.cpp.
|
private |
Flag to indicate that shutdown() has been called and changes in the list of reported data should not be reported to the client anymore.
Definition at line 179 of file TcpReporting.hpp.
|
protected |
marsh::MarshallInterface
Definition at line 186 of file TcpReporting.hpp.
|
private |
Definition at line 180 of file TcpReporting.hpp.
|
private |
Definition at line 181 of file TcpReporting.hpp.