00001 // -*- C++ -*- 00020 #ifndef PublisherBase_h 00021 #define PublisherBase_h 00022 00023 #include <coil/Properties.h> 00024 #include <coil/Factory.h> 00025 #include <rtm/RTC.h> 00026 #include <rtm/CdrBufferBase.h> 00027 #include <rtm/DataPortStatus.h> 00028 00029 namespace coil 00030 { 00031 class Properties; 00032 } 00033 namespace RTC 00034 { 00035 class InPortConsumer; 00036 00061 class PublisherBase 00062 : public DataPortStatus 00063 { 00064 public: 00065 DATAPORTSTATUS_ENUM 00077 virtual ~PublisherBase(void){}; 00078 00106 virtual ReturnCode init(coil::Properties& prop) = 0; 00107 virtual ReturnCode setConsumer(InPortConsumer* consumer) = 0; 00108 virtual ReturnCode setBuffer(BufferBase<cdrMemoryStream>* buffer) = 0; 00109 virtual ReturnCode write(const cdrMemoryStream& data, 00110 unsigned long sec, 00111 unsigned long usec) = 0; 00112 00113 virtual bool isActive() = 0; 00114 virtual ReturnCode activate() = 0; 00115 virtual ReturnCode deactivate() = 0; 00116 00117 00118 00119 00138 virtual void release(){} 00139 }; 00140 00141 typedef coil::GlobalFactory<PublisherBase> PublisherFactory; 00142 00143 }; 00144 #endif // PublisherBase_h