1 #ifndef CommonTools_Utils_StringObjectFunction_h 2 #define CommonTools_Utils_StringObjectFunction_h 15 template <
typename T,
bool DefaultLazyness = false>
18 if (!reco::parser::expressionParser<T>(expr,
expr_, lazy)) {
25 return expr_->value(o);
33 template <
typename Object>
39 bool operator()(
const Object *
o1,
const Object *o2) {
return (*f_)(*o1) > (*f_)(*o2); }
std::shared_ptr< ExpressionBase > ExpressionPtr
StringObjectFunction(const reco::parser::ExpressionPtr &expr)
StringObjectFunction(const std::string &expr, bool lazy=DefaultLazyness)
bool operator()(const Object *o1, const Object *o2)
reco::parser::ExpressionPtr expr_
StringObjectFunction< Object > * f_
double operator()(const T &t) const
sortByStringFunction(StringObjectFunction< Object > *f)