00001 // -*- C++ -*- 00020 /* 00021 * $Log: PortCallBack.h,v $ 00022 * Revision 1.2 2007/01/21 12:56:35 n-ando 00023 * virtual dtors were defined. 00024 * 00025 * Revision 1.1 2006/12/02 18:51:18 n-ando 00026 * The first commitment. 00027 * 00028 * 00029 */ 00030 00031 #ifndef PortCallBack_h 00032 #define PortCallBack_h 00033 00034 namespace RTC 00035 { 00036 //============================================================ 00037 // callback functor base classes 00052 template <class DataType> 00053 struct OnWrite 00054 { 00055 virtual ~OnWrite(){} 00056 virtual void operator()(const DataType& value) = 0; 00057 }; 00058 00073 template <class DataType> 00074 struct OnWriteConvert 00075 { 00076 virtual ~OnWriteConvert(){} 00077 virtual DataType operator()(const DataType& value) = 0; 00078 }; 00079 00094 template <class DataType> 00095 struct OnRead 00096 { 00097 virtual ~OnRead(){} 00098 virtual void operator()() = 0; 00099 }; 00100 00115 template <class DataType> 00116 struct OnReadConvert 00117 { 00118 virtual ~OnReadConvert(){} 00119 virtual DataType operator()(const DataType& value) = 0; 00120 }; 00121 00136 template <class DataType> 00137 struct OnOverflow 00138 { 00139 virtual ~OnOverflow(){} 00140 virtual void operator()(const DataType& value) = 0; 00141 }; 00142 00156 template <class DataType> 00157 struct OnUnderflow 00158 { 00159 virtual ~OnUnderflow(){} 00160 virtual DataType operator()() = 0; 00161 }; 00162 00163 }; 00164 #endif // PortCallBack_h