Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:11

0001 #ifndef CommonTools_UtilAlgos_FreeFunctionSelector_h
0002 #define CommonTools_UtilAlgos_FreeFunctionSelector_h
0003 /* \class FreeFunctionSelector
0004  *
0005  * \author Luca Lista, INFN
0006  *
0007  * \version $Id: FreeFunctionSelector.h,v 1.1 2008/01/22 11:17:58 llista Exp $
0008  */
0009 template <typename T, bool (*f)(const T&)>
0010 struct FreeFunctionSelector {
0011   bool operator()(const T& t) { return f(t); }
0012 };
0013 
0014 #include "FWCore/Framework/interface/ConsumesCollector.h"
0015 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
0016 
0017 namespace reco {
0018   namespace modules {
0019     template <typename T, bool (*f)(const T&)>
0020     struct ParameterAdapter<FreeFunctionSelector<T, f> > {
0021       typedef FreeFunctionSelector<T, f> value_type;
0022       static value_type make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) { return value_type(); }
0023     };
0024   }  // namespace modules
0025 }  // namespace reco
0026 
0027 #endif