Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Converter.h

Go to the documentation of this file.
00001 // $Id: Converter.h,v 1.1.1.1 1999/12/20 22:27:42 burnett Exp $
00002 // 
00003 //  Original author: Sawyer Gillespie
00004 //                   hgillesp@u.washington.edu
00005 //
00006 
00007 #ifndef _H_Converter_facilities_
00008 #define _H_Converter_facilities_
00009 
00010 // class Converter
00011 //  Template class to define the converter behavior. This is really just 
00012 //  specifying a pattern.
00013 //
00014 template <class Ty1, class Ty2>
00015 class   Converter {
00016 public:
00017     // type declarations
00018     typedef Ty1     source;
00019     typedef Ty2     destination;
00020 
00021     // declare the forward method
00022     inline destination*    operator (const source&) const;
00023 
00024 protected:
00025     // do the actual conversion here
00026     virtual destination*    convert (const source&) const = 0;
00027 };
00028 
00029 // inline declarations
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_

Generated at Mon Nov 26 18:18:26 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000