PublisherFlush.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef RTC_PUBLISHERFLUSH_H
21 #define RTC_PUBLISHERFLUSH_H
22 
23 #include <coil/Condition.h>
24 #include <rtm/PublisherBase.h>
25 #include <rtm/SystemLogger.h>
26 #include <rtm/ConnectorBase.h>
27 #include <rtm/ConnectorListener.h>
28 
29 namespace coil
30 {
31  class Properties;
32 };
33 
34 namespace RTC
35 {
36  class InPortConsumer;
37 
59  : public PublisherBase
60  {
61  public:
62  typedef coil::Mutex Mutex;
66 
81 
95  virtual ~PublisherFlush(void);
96 
121  virtual ReturnCode init(coil::Properties& prop);
122 
148  virtual ReturnCode setConsumer(InPortConsumer* consumer);
149 
171  virtual ReturnCode setBuffer(CdrBufferBase* buffer);
172 
206  virtual ::RTC::DataPortStatus::Enum
207  setListener(ConnectorInfo& profile,
208  RTC::ConnectorListeners* listeners);
209 
268  virtual ReturnCode write(const cdrMemoryStream& data,
269  unsigned long sec,
270  unsigned long usec);
298  virtual bool isActive();
299 
325  virtual ReturnCode activate();
326 
352  virtual ReturnCode deactivate();
353 
354  protected:
364  inline void onSend(const cdrMemoryStream& data)
365  {
366  m_listeners->
367  connectorData_[ON_SEND].notify(m_profile, data);
368  }
369 
379  inline void onReceived(const cdrMemoryStream& data)
380  {
381  m_listeners->
382  connectorData_[ON_RECEIVED].notify(m_profile, data);
383  }
384 
394  inline void onReceiverFull(const cdrMemoryStream& data)
395  {
396  m_listeners->
397  connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
398  }
399 
409  inline void onReceiverTimeout(const cdrMemoryStream& data)
410  {
411  m_listeners->
412  connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
413  }
414 
424  inline void onReceiverError(const cdrMemoryStream& data)
425  {
426  m_listeners->
427  connectorData_[ON_RECEIVER_ERROR].notify(m_profile, data);
428  }
429 
430  private:
436  Mutex m_retmutex;
437  bool m_active;
438  };
439 
440 }; // namespace RTC
441 
442 extern "C"
443 {
445 };
446 
447 #endif // RTC_PUBLISHERFLUSH_H
448 
ConnectorListeners class.
InPortConsumer abstract class.
InPortConsumer * m_consumer
#define DATAPORTSTATUS_ENUM
Importing RTC::DataPortStatus macro.
RT-Component.
void DLL_EXPORT PublisherFlushInit()
void onReceiverError(const cdrMemoryStream &data)
Notify an ON_RECEIVER_ERROR event to listeners.
Mutex class.
RT component logger class.
Enum
DataPortStatus return codes.
Definition: BufferStatus.h:84
void onReceived(const cdrMemoryStream &data)
Notify an ON_RECEIVED event to listeners.
Connector base class.
coil::Condition< Mutex > Condition
void onSend(const cdrMemoryStream &data)
Notify an ON_SEND event to listners.
void onReceiverTimeout(const cdrMemoryStream &data)
Notify an ON_RECEIVER_TIMEOUT event to listeners.
#define DLL_EXPORT
Definition: PluginC.cpp:8
Condition template class.
prop
Organization::get_organization_property ();.
Publisher base class.
Class represents a set of properties.
Definition: Properties.h:101
ConnectorListeners * m_listeners
Base class of Publisher.
Definition: PublisherBase.h:63
BufferBase abstract class.
Definition: BufferBase.h:104
connector listener class
ConnectorInfo m_profile
coil::Guard< coil::Mutex > Guard
Common Object Interface Layer.
void onReceiverFull(const cdrMemoryStream &data)
Notify an ON_RECEIVER_FULL event to listeners.


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