OpenRTM  1.0.0
OutPortConsumer.h
説明を見る。
1 // -*- C++ -*-
20 #ifndef RTC_OUTPORTCONSUMER_H
21 #define RTC_OUTPORTCONSUMER_H
22 
23 #include <coil/Factory.h>
24 #include <rtm/DataPortStatus.h>
25 #include <rtm/CdrBufferBase.h>
26 
27 // Why RtORB does not allow the following foward declaration?
28 #ifndef ORB_IS_RTORB
29 namespace SDOPackage
30 {
31  class NVList;
32 };
33 #endif // ORB_IS_RTORB
34 
35 namespace coil
36 {
37  class Properties;
38 };
39 
40 namespace RTC
41 {
42  class ConnectorListeners;
43  class ConnectorInfo;
44 
172  : public DataPortStatus
173  {
174  public:
176 
191  virtual ~OutPortConsumer(void){};
192 
220  virtual void init(coil::Properties& prop) = 0;
221 
247  virtual void setBuffer(CdrBufferBase* buffer) = 0;
248 
279  virtual void setListener(ConnectorInfo& info,
280  ConnectorListeners* listeners) = 0;
281 
308  virtual ReturnCode get(cdrMemoryStream& data) = 0;
309 
335  virtual bool subscribeInterface(const SDOPackage::NVList& properties) = 0;
336 
360  virtual void unsubscribeInterface(const SDOPackage::NVList& properties) = 0;
361 
362  protected:
370  mutable Logger rtclog;
371 
379  struct subscribe
380  {
381  subscribe(const SDOPackage::NVList& prop) : m_prop(prop) {}
382  void operator()(OutPortConsumer* consumer)
383  {
384  consumer->subscribeInterface(m_prop);
385  }
386  const SDOPackage::NVList& m_prop;
387  };
388 
396  struct unsubscribe
397  {
398  unsubscribe(const SDOPackage::NVList& prop) : m_prop(prop) {}
399  void operator()(OutPortConsumer* consumer)
400  {
401  consumer->unsubscribeInterface(m_prop);
402  }
403  const SDOPackage::NVList& m_prop;
404  };
405  };
406 
414  typedef ::coil::GlobalFactory<OutPortConsumer> OutPortConsumerFactory;
415 
416 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
417  EXTERN template class DLL_PLUGIN ::coil::GlobalFactory<OutPortConsumer>;
418 #endif
419 }; // namespace RTC
420 #endif // RTC_OUTPORTCONSUMER_H
421