CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
StringObjectFunction< T, DefaultLazyness > Struct Template Reference

#include <StringObjectFunction.h>

Public Member Functions

double operator() (const T &t) const
 
 StringObjectFunction (const reco::parser::ExpressionPtr &expr)
 
 StringObjectFunction (const std::string &expr, bool lazy=DefaultLazyness)
 

Private Attributes

reco::parser::ExpressionPtr expr_
 
edm::TypeWithDict type_
 

Detailed Description

template<typename T, bool DefaultLazyness = false>
struct StringObjectFunction< T, DefaultLazyness >

Definition at line 16 of file StringObjectFunction.h.

Constructor & Destructor Documentation

◆ StringObjectFunction() [1/2]

template<typename T, bool DefaultLazyness = false>
StringObjectFunction< T, DefaultLazyness >::StringObjectFunction ( const std::string &  expr,
bool  lazy = DefaultLazyness 
)
inline

Definition at line 17 of file StringObjectFunction.h.

17  : type_(typeid(T)) {
18  if (!reco::parser::expressionParser<T>(expr, expr_, lazy)) {
19  throw edm::Exception(edm::errors::Configuration, "failed to parse \"" + expr + "\"");
20  }
21  }

◆ StringObjectFunction() [2/2]

template<typename T, bool DefaultLazyness = false>
StringObjectFunction< T, DefaultLazyness >::StringObjectFunction ( const reco::parser::ExpressionPtr expr)
inline

Definition at line 22 of file StringObjectFunction.h.

22 : expr_(expr), type_(typeid(T)) {}

Member Function Documentation

◆ operator()()

template<typename T, bool DefaultLazyness = false>
double StringObjectFunction< T, DefaultLazyness >::operator() ( const T t) const
inline

Definition at line 23 of file StringObjectFunction.h.

23  {
24  edm::ObjectWithDict o(type_, const_cast<T *>(&t));
25  return expr_->value(o);
26  }

Member Data Documentation

◆ expr_

template<typename T, bool DefaultLazyness = false>
reco::parser::ExpressionPtr StringObjectFunction< T, DefaultLazyness >::expr_
private

◆ type_

template<typename T, bool DefaultLazyness = false>
edm::TypeWithDict StringObjectFunction< T, DefaultLazyness >::type_
private
edm::ObjectWithDict
Definition: ObjectWithDict.h:17
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
StringObjectFunction::type_
edm::TypeWithDict type_
Definition: StringObjectFunction.h:30
jets_cff.expr
expr
Definition: jets_cff.py:485
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:246
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
StringObjectFunction::expr_
reco::parser::ExpressionPtr expr_
Definition: StringObjectFunction.h:29
edm::errors::Configuration
Definition: EDMException.h:36