00001 // -*- C++ -*- 00020 #ifndef RTC_OUTPORTPULLCONNECTOR_H 00021 #define RTC_OUTPORTPULLCONNECTOR_H 00022 00023 #include <rtm/InPortConnector.h> 00024 #include <rtm/InPortProvider.h> 00025 #include <rtm/PublisherBase.h> 00026 #include <rtm/DataPortStatus.h> 00027 00028 namespace RTC 00029 { 00030 class OutPortConsumer; 00031 class ConnectorListeners; 00032 00052 class InPortPullConnector 00053 : public InPortConnector 00054 { 00055 public: 00056 DATAPORTSTATUS_ENUM 00064 InPortPullConnector(ConnectorInfo info, 00065 OutPortConsumer* consumer, 00066 ConnectorListeners& listeners, 00067 CdrBufferBase* buffer = 0); 00068 00076 virtual ~InPortPullConnector(); 00077 00091 virtual ReturnCode read(cdrMemoryStream& data); 00092 00106 virtual ReturnCode disconnect(); 00107 00122 virtual void activate(){}; // do nothing 00123 00138 virtual void deactivate(){}; // do nothing 00139 00140 protected: 00148 CdrBufferBase* createBuffer(ConnectorInfo& info); 00149 00157 void onConnect(); 00158 00166 void onDisconnect(); 00167 00168 private: 00176 OutPortConsumer* m_consumer; 00177 00185 ConnectorListeners& m_listeners; 00186 }; 00187 }; // namespace RTC 00188 00189 #endif // RTC_PULL_CONNECTOR_H