File indexing completed on 2025-02-05 23:51:10
0001 #ifndef CommonTools_UtilAlgos_FreeFunctionSelector_h
0002 #define CommonTools_UtilAlgos_FreeFunctionSelector_h
0003
0004
0005
0006
0007
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 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0017
0018 namespace reco {
0019 namespace modules {
0020 template <typename T, bool (*f)(const T&)>
0021 struct ParameterAdapter<FreeFunctionSelector<T, f> > {
0022 typedef FreeFunctionSelector<T, f> value_type;
0023 static value_type make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) { return value_type(); }
0024
0025 static void fillPSetDescription(edm::ParameterSetDescription& desc) {}
0026 };
0027 }
0028 }
0029
0030 #endif