00001 // -*- C++ -*- 00020 #ifndef PublisherFlush_h 00021 #define PublisherFlush_h 00022 00023 #include <coil/Condition.h> 00024 #include <rtm/PublisherBase.h> 00025 00026 namespace coil 00027 { 00028 class Properties; 00029 }; 00030 00031 namespace RTC 00032 { 00033 class InPortConsumer; 00054 class PublisherFlush 00055 : public PublisherBase 00056 { 00057 public: 00058 typedef coil::Mutex Mutex; 00059 typedef coil::Condition<Mutex> Condition; 00060 typedef coil::Guard<coil::Mutex> Guard; 00061 DATAPORTSTATUS_ENUM 00062 00083 PublisherFlush(); 00084 00100 virtual ~PublisherFlush(void); 00101 00109 virtual ReturnCode init(coil::Properties& prop); 00110 00111 virtual ReturnCode setConsumer(InPortConsumer* consumer); 00112 virtual ReturnCode setBuffer(CdrBufferBase* buffer); 00113 virtual ReturnCode write(const cdrMemoryStream& data, 00114 unsigned long sec, 00115 unsigned long usec); 00116 virtual bool isActive(); 00117 virtual ReturnCode activate(); 00118 virtual ReturnCode deactivate(); 00119 00120 protected: 00121 00122 private: 00123 InPortConsumer* m_consumer; 00124 ReturnCode m_retcode; 00125 Mutex m_retmutex; 00126 bool m_active; 00127 }; 00128 00129 }; // namespace RTC 00130 00131 extern "C" 00132 { 00133 void DLL_EXPORT PublisherFlushInit(); 00134 }; 00135 00136 #endif // PublisherFlush_h 00137