OutPortCorbaCdrConsumer.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef RTC_OUTPORTCORBACDRCONSUMER_H
21 #define RTC_OUTPORTCORBACDRCONSUMER_H
22 
23 #include <rtm/idl/DataPortSkel.h>
24 #include <rtm/CorbaConsumer.h>
25 #include <rtm/OutPortConsumer.h>
26 #include <rtm/ConnectorListener.h>
27 #include <rtm/ConnectorBase.h>
28 
29 namespace RTC
30 {
56  : public OutPortConsumer,
57  public CorbaConsumer< ::OpenRTM::OutPortCdr >
58  {
59  public:
61 
76 
90  virtual ~OutPortCorbaCdrConsumer(void);
91 
119  virtual void init(coil::Properties& prop);
120 
146  virtual void setBuffer(CdrBufferBase* buffer);
147 
192  virtual void setListener(ConnectorInfo& info,
193  ConnectorListeners* listeners);
194 
216  virtual ReturnCode get(cdrMemoryStream& data);
217 
240  virtual bool subscribeInterface(const SDOPackage::NVList& properties);
241 
259  virtual void unsubscribeInterface(const SDOPackage::NVList& properties);
260 
261  private:
269  OutPortConsumer::ReturnCode convertReturn(::OpenRTM::PortStatus status,
270  const cdrMemoryStream& data);
271 
281  inline void onBufferWrite(const cdrMemoryStream& data)
282  {
283  m_listeners->
284  connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
285  }
286 
296  inline void onBufferFull(const cdrMemoryStream& data)
297  {
298  m_listeners->
299  connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
300  }
301 
311  inline void onReceived(const cdrMemoryStream& data)
312  {
313  m_listeners->
314  connectorData_[ON_RECEIVED].notify(m_profile, data);
315  }
316 
326  inline void onReceiverFull(const cdrMemoryStream& data)
327  {
328  m_listeners->
329  connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
330  }
331 
339  inline void onSenderEmpty()
340  {
341  m_listeners->
342  connector_[ON_SENDER_EMPTY].notify(m_profile);
343  }
344 
352  inline void onSenderTimeout()
353  {
354  m_listeners->
355  connector_[ON_SENDER_TIMEOUT].notify(m_profile);
356  }
357 
365  inline void onSenderError()
366  {
367  m_listeners->
368  connector_[ON_SENDER_ERROR].notify(m_profile);
369  }
370 
371  // RTC::OutPortCdr_var m_outport;
375  };
376 }; // namespace RTC
377 
378 extern "C"
379 {
393  void OutPortCorbaCdrConsumerInit(void);
394 };
395 
396 #endif // RTC_OUTPORTCORBACDRCONSUMER_H
ConnectorListeners class.
CORBA Consumer class.
#define DATAPORTSTATUS_ENUM
Importing RTC::DataPortStatus macro.
RT-Component.
OutPortConsumer::ReturnCode convertReturn(::OpenRTM::PortStatus status, const cdrMemoryStream &data)
Return codes conversion.
void onSenderEmpty()
Notify an ON_SENDER_EMPTY event to listeners.
std::vector< std::pair< std::string, std::string > > NVList
Definition: IRTC.h:67
void onBufferFull(const cdrMemoryStream &data)
Notify an ON_BUFFER_FULL event to listeners.
OutPortConsumer class.
virtual void unsubscribeInterface(const SDOPackage::NVList &properties)
Unsubscribe the data receive notification.
Enum
DataPortStatus return codes.
Definition: BufferStatus.h:84
DATAPORTSTATUS_ENUM OutPortCorbaCdrConsumer()
Constructor.
Connector base class.
void OutPortCorbaCdrConsumerInit(void)
Module initialization.
void onReceived(const cdrMemoryStream &data)
Notify an ON_RECEIVED event to listeners.
virtual ~OutPortCorbaCdrConsumer(void)
Destructor.
::RTC::BufferStatus::Enum ReturnCode
prop
Organization::get_organization_property ();.
void onBufferWrite(const cdrMemoryStream &data)
Notify an ON_BUFFER_WRITE event to listeners.
void onReceiverFull(const cdrMemoryStream &data)
Notify an ON_RECEIVER_FULL event to listeners.
virtual bool subscribeInterface(const SDOPackage::NVList &properties)
Subscribe the data receive notification.
Class represents a set of properties.
Definition: Properties.h:101
void onSenderTimeout()
Notify an ON_SENDER_TIMEOUT event to listeners.
OutPortConsumer abstract class.
virtual void setListener(ConnectorInfo &info, ConnectorListeners *listeners)
Set the listener.
virtual void setBuffer(CdrBufferBase *buffer)
Setting outside buffer&#39;s pointer.
BufferBase abstract class.
Definition: BufferBase.h:104
connector listener class
virtual void init(coil::Properties &prop)
Initializing configuration.


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:43