00001 // -*- C++ -*- 00020 #ifndef RTC_OUTPORTCONSUMER_H 00021 #define RTC_OUTPORTCONSUMER_H 00022 00023 #include <coil/Factory.h> 00024 #include <rtm/DataPortStatus.h> 00025 #include <rtm/CdrBufferBase.h> 00026 00027 namespace SDOPackage 00028 { 00029 class NVList; 00030 }; 00031 00032 namespace coil 00033 { 00034 class Properties; 00035 }; 00036 00037 namespace RTC 00038 { 00069 class OutPortConsumer 00070 : public DataPortStatus 00071 { 00072 public: 00073 DATAPORTSTATUS_ENUM 00074 00089 virtual ~OutPortConsumer(void){}; 00090 00118 virtual void init(coil::Properties& prop) = 0; 00119 00145 virtual void setBuffer(CdrBufferBase* buffer) = 0; 00146 00173 virtual ReturnCode get(cdrMemoryStream& data) = 0; 00174 00200 virtual bool subscribeInterface(const SDOPackage::NVList& properties) = 0; 00201 00225 virtual void unsubscribeInterface(const SDOPackage::NVList& properties) = 0; 00226 00234 struct subscribe 00235 { 00236 subscribe(const SDOPackage::NVList& prop) : m_prop(prop) {} 00237 void operator()(OutPortConsumer* consumer) 00238 { 00239 consumer->subscribeInterface(m_prop); 00240 } 00241 const SDOPackage::NVList& m_prop; 00242 }; 00243 00251 struct unsubscribe 00252 { 00253 unsubscribe(const SDOPackage::NVList& prop) : m_prop(prop) {} 00254 void operator()(OutPortConsumer* consumer) 00255 { 00256 consumer->unsubscribeInterface(m_prop); 00257 } 00258 const SDOPackage::NVList& m_prop; 00259 }; 00260 }; 00261 00262 typedef ::coil::GlobalFactory<OutPortConsumer> OutPortConsumerFactory; 00263 00264 }; // namespace RTC 00265 #endif // OutPortConsumer_h 00266