00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 1999-2008 Soeren Sonnenburg 00008 * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _CSIMPLEPREPROC__H__ 00012 #define _CSIMPLEPREPROC__H__ 00013 00014 #include "features/Features.h" 00015 #include "features/SimpleFeatures.h" 00016 #include "lib/common.h" 00017 #include "preproc/PreProc.h" 00018 00019 template <class ST> class CSimpleFeatures; 00020 00022 template <class ST> class CSimplePreProc : public CPreProc 00023 { 00024 public: 00030 CSimplePreProc(const CHAR *name, const CHAR* id) : CPreProc(name,id) {} 00031 00035 virtual ST* apply_to_feature_matrix(CFeatures* f)=0; 00036 00039 00040 virtual ST* apply_to_feature_vector(ST* f, INT &len)=0; 00041 00043 inline virtual EFeatureClass get_feature_class() { return C_SIMPLE; } 00045 inline virtual EFeatureType get_feature_type(); 00046 }; 00047 00048 template<> inline EFeatureType CSimplePreProc<DREAL>::get_feature_type() 00049 { 00050 return F_DREAL; 00051 } 00052 00053 template<> inline EFeatureType CSimplePreProc<SHORT>::get_feature_type() 00054 { 00055 return F_SHORT; 00056 } 00057 00058 template<> inline EFeatureType CSimplePreProc<WORD>::get_feature_type() 00059 { 00060 return F_WORD; 00061 } 00062 00063 template<> inline EFeatureType CSimplePreProc<CHAR>::get_feature_type() 00064 { 00065 return F_CHAR; 00066 } 00067 00068 template<> inline EFeatureType CSimplePreProc<BYTE>::get_feature_type() 00069 { 00070 return F_BYTE; 00071 } 00072 00073 template<> inline EFeatureType CSimplePreProc<ULONG>::get_feature_type() 00074 { 00075 return F_ULONG; 00076 } 00077 00078 #endif