00001 // -*- C++ -*- 00020 #ifndef RTC_PORTCALLBACK_H 00021 #define RTC_PORTCALLBACK_H 00022 00023 class cdrStream; 00024 00025 namespace RTC 00026 { 00027 00028 00029 00030 //============================================================ 00031 // callback functor base classes 00058 class ConnectionCallback 00059 { 00060 public: 00074 virtual ~ConnectionCallback(void){} 00096 virtual void operator()(RTC::ConnectorProfile& profile) = 0; 00097 }; 00098 00125 class DisconnectCallback 00126 { 00127 public: 00141 virtual ~DisconnectCallback(void){} 00163 virtual void operator()(const char* connector_id) = 0; 00164 }; 00165 00191 template <class DataType> 00192 class OnWrite 00193 { 00194 public: 00208 virtual ~OnWrite(void){} 00209 00230 virtual void operator()(const DataType& value) = 0; 00231 }; 00232 00256 template <class DataType> 00257 struct OnWriteConvert 00258 { 00272 virtual ~OnWriteConvert(void){} 00273 00298 virtual DataType operator()(const DataType& value) = 0; 00299 }; 00300 00322 template <class DataType> 00323 struct OnRead 00324 { 00340 virtual ~OnRead(void){} 00341 00358 virtual void operator()() = 0; 00359 }; 00360 00384 template <class DataType> 00385 struct OnReadConvert 00386 { 00402 virtual ~OnReadConvert(void){} 00403 00420 virtual DataType operator()(const DataType& value) = 0; 00421 }; 00422 00423 00424 }; 00425 #endif // RTC_PORTCALLBACK_H