CMS 3D CMS Logo

Public Member Functions | Private Attributes

StringObjectFunction< T, DefaultLazyness > Struct Template Reference

#include <StringObjectFunction.h>

List of all members.

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_
Reflex::Type type_

Detailed Description

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

Definition at line 15 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 16 of file StringObjectFunction.h.

                                                                          : 
    type_(Reflex::Type::ByTypeInfo(typeid(T))) {
    if(! reco::parser::expressionParser<T>(expr, expr_, lazy)) {
      throw edm::Exception(edm::errors::Configuration,
                           "failed to parse \"" + expr + "\"");
    }
  }
template<typename T, bool DefaultLazyness = false>
StringObjectFunction< T, DefaultLazyness >::StringObjectFunction ( const reco::parser::ExpressionPtr expr) [inline]

Definition at line 23 of file StringObjectFunction.h.

                                                             : 
    expr_(expr),
    type_(Reflex::Type::ByTypeInfo(typeid(T))) {
  }

Member Function Documentation

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

Definition at line 27 of file StringObjectFunction.h.

                                       {
    using namespace Reflex;
    Object o(type_, const_cast<T *>(& t));
    return expr_->value(o);  
  }

Member Data Documentation

template<typename T, bool DefaultLazyness = false>
reco::parser::ExpressionPtr StringObjectFunction< T, DefaultLazyness >::expr_ [private]
template<typename T, bool DefaultLazyness = false>
Reflex::Type StringObjectFunction< T, DefaultLazyness >::type_ [private]