CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 std::string &expr, bool lazy=DefaultLazyness)
 
 StringObjectFunction (const reco::parser::ExpressionPtr &expr)
 

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

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  :
18  type_(typeid(T)) {
19  if(! reco::parser::expressionParser<T>(expr, expr_, lazy)) {
21  "failed to parse \"" + expr + "\"");
22  }
23  }
edm::TypeWithDict type_
reco::parser::ExpressionPtr expr_
long double T
template<typename T, bool DefaultLazyness = false>
StringObjectFunction< T, DefaultLazyness >::StringObjectFunction ( const reco::parser::ExpressionPtr expr)
inline

Definition at line 24 of file StringObjectFunction.h.

24  :
25  expr_(expr),
26  type_(typeid(T)) {
27  }
edm::TypeWithDict type_
reco::parser::ExpressionPtr expr_
long double T

Member Function Documentation

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

Definition at line 28 of file StringObjectFunction.h.

28  {
29  edm::ObjectWithDict o(type_, const_cast<T *>(& t));
30  return expr_->value(o);
31  }
tuple t
Definition: tree.py:139
edm::TypeWithDict type_
reco::parser::ExpressionPtr expr_

Member Data Documentation

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