CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/CommonTools/UtilAlgos/interface/FreeFunctionSelector.h

Go to the documentation of this file.
00001 #ifndef CommonTools_UtilAlgos_FreeFunctionSelector_h
00002 #define CommonTools_UtilAlgos_FreeFunctionSelector_h
00003 /* \class FreeFunctionSelector
00004  *
00005  * \author Luca Lista, INFN
00006  * 
00007  * \version $Id: FreeFunctionSelector.h,v 1.1 2009/03/03 13:07:26 llista Exp $  
00008  */
00009 template<typename T, bool f(const T&)>
00010 struct FreeFunctionSelector {
00011   bool operator()(const T& t) {
00012     return f(t);
00013   }
00014 };
00015 
00016 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
00017 
00018 namespace reco {
00019   namespace modules {
00020     template<typename T, bool f(const T&)>
00021     struct ParameterAdapter<FreeFunctionSelector<T, f> > { 
00022       typedef FreeFunctionSelector<T, f> value_type;
00023       static value_type make(const edm::ParameterSet & cfg) {
00024         return value_type();
00025       }
00026     };
00027   }
00028 }
00029 
00030 
00031 
00032 #endif