SeqOut.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00010 #ifndef SEQOUT_H
00011 #define SEQOUT_H
00012 
00013 #include <rtm/idl/BasicDataTypeSkel.h>
00014 #include <rtm/Manager.h>
00015 #include <rtm/DataFlowComponentBase.h>
00016 #include <rtm/CorbaPort.h>
00017 #include <rtm/DataInPort.h>
00018 #include <rtm/DataOutPort.h>
00019 
00020 // Service implementation headers
00021 // <rtc-template block="service_impl_h">
00022 
00023 // </rtc-template>
00024 
00025 // Service Consumer stub headers
00026 // <rtc-template block="consumer_stub_h">
00027 
00028 // </rtc-template>
00029 
00030 using namespace RTC;
00031 
00032 // Connector Listener Dump Flag
00033 extern bool g_Listener_dump_enabled;
00034 
00035 class DataListener
00036   : public ConnectorDataListenerT<RTC::TimedLong>
00037 {
00038 public:
00039   DataListener(const char* name) : m_name(name) {}
00040   virtual ~DataListener()
00041   {
00042     // Connector Listener Dump check
00043     if(g_Listener_dump_enabled)
00044       {
00045         std::cout << "dtor of " << m_name << std::endl;
00046       }
00047   }
00048 
00049   virtual void operator()(const ConnectorInfo& info,
00050                           const TimedLong& data)
00051   {
00052     // Connector Listener Dump check
00053     if(g_Listener_dump_enabled)
00054       {
00055         std::cout << "------------------------------"   << std::endl;
00056         std::cout << "Data Listener: " << m_name       << std::endl;
00057         std::cout << "Profile::name: " << info.name    << std::endl;
00058         std::cout << "Profile::id:   " << info.id      << std::endl;
00059 //        std::cout << "Profile::properties: "            << std::endl;
00060 //        std::cout << info.properties;
00061 //        std::cout                                       << std::endl;
00062         std::cout << "Data:          " << data.data    << std::endl;
00063         std::cout << "------------------------------"   << std::endl;
00064       }
00065   }
00066   std::string m_name;
00067 };
00068 
00069 
00070 class ConnListener
00071   : public ConnectorListener
00072 {
00073 public:
00074   ConnListener(const char* name) : m_name(name) {}
00075   virtual ~ConnListener()
00076   {
00077     // Connector Listener Dump check
00078     if(g_Listener_dump_enabled)
00079       {
00080         std::cout << "dtor of " << m_name << std::endl;
00081       }
00082   }
00083 
00084   virtual void operator()(const ConnectorInfo& info)
00085   {
00086     // Connector Listener Dump check
00087     if(g_Listener_dump_enabled)
00088       {
00089         std::cout << "------------------------------"   << std::endl;
00090         std::cout << "Connector Listener: " << m_name       << std::endl;
00091         std::cout << "Profile::name:      " << info.name    << std::endl;
00092         std::cout << "Profile::id:        " << info.id      << std::endl;
00093         std::cout << "Profile::properties: "            << std::endl;
00094         std::cout << info.properties;
00095         std::cout                                       << std::endl;
00096         std::cout << "------------------------------"   << std::endl;
00097       }
00098   };
00099   std::string m_name;
00100 };
00101 
00102 
00103 class SeqOut
00104   : public RTC::DataFlowComponentBase
00105 {
00106  public:
00107   SeqOut(RTC::Manager* manager);
00108   ~SeqOut();
00109 
00110   // The initialize action (on CREATED->ALIVE transition)
00111   // formaer rtc_init_entry() 
00112   virtual RTC::ReturnCode_t onInitialize();
00113 
00114   // The finalize action (on ALIVE->END transition)
00115   // formaer rtc_exiting_entry()
00116   // virtual RTC::ReturnCode_t onFinalize();
00117 
00118   // The startup action when ExecutionContext startup
00119   // former rtc_starting_entry()
00120   // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
00121 
00122   // The shutdown action when ExecutionContext stop
00123   // former rtc_stopping_entry()
00124   // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
00125 
00126   // The activated action (Active state entry action)
00127   // former rtc_active_entry()
00128   // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
00129 
00130   // The deactivated action (Active state exit action)
00131   // former rtc_active_exit()
00132   // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
00133 
00134   // The execution action that is invoked periodically
00135   // former rtc_active_do()
00136   virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
00137 
00138   // The aborting action when main logic error occurred.
00139   // former rtc_aborting_entry()
00140   // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
00141 
00142   // The error action in ERROR state
00143   // former rtc_error_do()
00144   // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
00145 
00146   // The reset action that is invoked resetting
00147   // This is same but different the former rtc_init_entry()
00148   // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
00149   
00150   // The state update action that is invoked after onExecute() action
00151   // no corresponding operation exists in OpenRTm-aist-0.2.0
00152   // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
00153 
00154   // The action that is invoked when execution context's rate is changed
00155   // no corresponding operation exists in OpenRTm-aist-0.2.0
00156   // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
00157 
00158  protected:
00159   // DataInPort declaration
00160   // <rtc-template block="inport_declare">
00161   
00162   // </rtc-template>
00163 
00164 
00165   // DataOutPort declaration
00166   // <rtc-template block="outport_declare">
00167   TimedOctet m_Octet;
00168   OutPort<TimedOctet> m_OctetOut;
00169   TimedShort m_Short;
00170   OutPort<TimedShort> m_ShortOut;
00171   TimedLong m_Long;
00172   OutPort<TimedLong> m_LongOut;
00173   TimedFloat m_Float;
00174   OutPort<TimedFloat> m_FloatOut;
00175   TimedDouble m_Double;
00176   OutPort<TimedDouble> m_DoubleOut;
00177   TimedOctetSeq m_OctetSeq;
00178   OutPort<TimedOctetSeq> m_OctetSeqOut;
00179   TimedShortSeq m_ShortSeq;
00180   OutPort<TimedShortSeq> m_ShortSeqOut;
00181   TimedLongSeq m_LongSeq;
00182   OutPort<TimedLongSeq> m_LongSeqOut;
00183   TimedFloatSeq m_FloatSeq;
00184   OutPort<TimedFloatSeq> m_FloatSeqOut;
00185   TimedDoubleSeq m_DoubleSeq;
00186   OutPort<TimedDoubleSeq> m_DoubleSeqOut;
00187   
00188   // </rtc-template>
00189 
00190   // CORBA Port declaration
00191   // <rtc-template block="corbaport_declare">
00192   
00193   // </rtc-template>
00194 
00195   // Service declaration
00196   // <rtc-template block="service_declare">
00197   
00198   // </rtc-template>
00199 
00200   // Consumer declaration
00201   // <rtc-template block="consumer_declare">
00202   
00203   // </rtc-template>
00204 
00205   // Configuration variable declaration
00206   // <rtc-template block="config_declare">
00207   std::string m_data_type;
00208 
00209   // </rtc-template>
00210 
00211  private:
00212 
00213 };
00214 
00215 extern "C"
00216 {
00217   DLL_EXPORT void SeqOutInit(RTC::Manager* manager);
00218 };
00219 
00220 #endif // SEQOUT_H


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sun Mar 26 2017 03:37:17