00001 // -*- C++ -*- 00020 #ifndef OutPortTcpSockProvider_h 00021 #define OutPortTcpSockProvider_h 00022 00023 #include <rtm/BufferBase.h> 00024 #include <rtm/OutPortProvider.h> 00025 00026 namespace RTC 00027 { 00048 template <class DataType> 00049 class OutPortTcpSockProvider 00050 : public OutPortProvider 00051 { 00052 public: 00078 OutPortTcpSockProvider(BufferBase<DataType>& buffer) 00079 : m_buffer(buffer) 00080 { 00081 CORBA::Any any_var; 00082 DataType tmp_var; 00083 any_var <<= tmp_var; 00084 00085 // PortProfile setting 00086 setDataType(any_var.type()->name()); 00087 setInterfaceType("TCP_Any"); 00088 setDataFlowType("Push, Pull"); 00089 setSubscriptionType("Flush, New, Periodic"); 00090 00091 // ConnectorProfile setting 00092 // m_objref = this->_this(); 00093 // CORBA_SeqUtil::push_back(m_properties, 00094 // NVUtil::newNV("dataport.corba_any.outport_ref", 00095 // m_objref)); 00096 } 00097 00105 virtual ~OutPortTcpSockProvider(void) 00106 {} 00107 00108 /* 00109 CORBA::Any* get() 00110 { 00111 DataType data; 00112 CORBA::Any_var tmp = new CORBA::Any(); 00113 m_buffer.read(data); 00114 tmp <<= data; 00115 return tmp._retn(); 00116 } 00117 */ 00118 00119 private: 00120 BufferBase<DataType>& m_buffer; 00121 // OutPortAny_var m_objref; 00122 }; 00123 }; // namespace RTC 00124 #endif // OutPortTcpSockProvider_h