Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ORO_REPORTING_COMPONENT_HPP
00029 #define ORO_REPORTING_COMPONENT_HPP
00030
00031
00032 #include <boost/tuple/tuple.hpp>
00033
00034 #include <rtt/Property.hpp>
00035 #include <rtt/PropertyBag.hpp>
00036 #include <rtt/marsh/MarshallInterface.hpp>
00037 #include <rtt/os/TimeService.hpp>
00038 #include <rtt/TaskContext.hpp>
00039
00040 #include <rtt/RTT.hpp>
00041
00042 #include <ocl/OCL.hpp>
00043
00044 namespace OCL
00045 {
00081 class ReportingComponent
00082 : public RTT::TaskContext
00083 {
00084 protected:
00088 bool screenImpl( const std::string& comp, std::ostream& output);
00089 public:
00090
00091 typedef RTT::DataFlowInterface::Ports Ports;
00092
00096 ReportingComponent( std::string name = "Reporting" );
00097
00098 virtual ~ReportingComponent();
00099
00112 bool addMarshaller( RTT::marsh::MarshallInterface* headerM, RTT::marsh::MarshallInterface* bodyM);
00113
00117 bool removeMarshallers();
00118
00128 virtual bool configureHook();
00129
00134 virtual void cleanupHook();
00135
00140 virtual bool screenComponent( const std::string& comp );
00141
00145 bool reportComponent( const std::string& component );
00146
00150 bool unreportComponent( const std::string& component );
00151
00155 bool reportPort(const std::string& component, const std::string& port );
00156
00160 bool unreportPort(const std::string& component, const std::string& port );
00161
00165 bool reportData(const std::string& component,const std::string& dataname);
00166
00170 bool unreportData(const std::string& component,const std::string& datasource);
00171
00177 bool copydata();
00178
00182 void snapshot();
00183
00184 void cleanReport();
00185
00188 protected:
00202 typedef boost::tuple<std::string,
00203 RTT::base::DataSourceBase::shared_ptr,
00204 std::string,RTT::base::PropertyBase*,RTT::base::InputPortInterface*,bool,bool> DTupple;
00205
00207 typedef enum { T_QualName = 0, T_PortDS, T_DataType, T_Property, T_Port, T_NewData, T_Tracked } T_Types;
00211 typedef std::vector<DTupple> Reports;
00212 Reports root;
00213
00214 bool reportDataSource(std::string tag, std::string type, RTT::base::DataSourceBase::shared_ptr origm, RTT::base::InputPortInterface* ipi, bool);
00215
00216 bool unreportDataSource(std::string tag);
00217
00218 virtual bool startHook();
00219
00220 void makeReport2();
00221
00225 virtual void updateHook();
00226
00227 virtual void stopHook();
00228
00229 typedef std::vector< std::pair<boost::shared_ptr<RTT::marsh::MarshallInterface>, boost::shared_ptr<RTT::marsh::MarshallInterface> > > Marshallers;
00230 Marshallers marshallers;
00231 RTT::PropertyBag report;
00232
00237 bool snapshotted;
00238 RTT::Property<std::string> config;
00239 RTT::Property<bool> writeHeader;
00240 RTT::Property<bool> decompose;
00241 RTT::Property<bool> insnapshot;
00242 RTT::Property<bool> synchronize_with_logging;
00243 RTT::Property<PropertyBag> report_data;
00244 RTT::ConnPolicy report_policy;
00245 bool onlyNewData;
00246
00247 RTT::os::TimeService::ticks starttime;
00248 RTT::Property<RTT::os::TimeService::Seconds> timestamp;
00250 RTT::internal::DataSource<bool>::shared_ptr mchecker;
00251
00252 };
00253
00254 }
00255
00256 #endif