00001
00002
00003
00004
00005
00006
00007 #ifndef _H_Converter_facilities_
00008 #define _H_Converter_facilities_
00009
00010
00011
00012
00013
00014 template <class Ty1, class Ty2>
00015 class Converter {
00016 public:
00017
00018 typedef Ty1 source;
00019 typedef Ty2 destination;
00020
00021
00022 inline destination* operator (const source&) const;
00023
00024 protected:
00025
00026 virtual destination* convert (const source&) const = 0;
00027 };
00028
00029
00030
00031 template <class Ty1, class Ty2>
00032 inline Converter<Ty1,Ty2>::destination*
00033 Converter<Ty1,Ty2>::operator () (const Converter<Ty1,Ty2>::source& s) const
00034 {
00035 return convert (s);
00036 }
00037
00038 #endif // _H_Converter_facilities_