CMS 3D CMS Logo

StringObjectFunction< T > Struct Template Reference

#include <PhysicsTools/Utilities/interface/StringObjectFunction.h>

List of all members.

Public Member Functions

double operator() (const T &t) const
 StringObjectFunction (const reco::parser::ExpressionPtr &expr)
 StringObjectFunction (const std::string &expr)

Private Attributes

reco::parser::ExpressionPtr expr_
ROOT::Reflex::Type type_


Detailed Description

template<typename T>
struct StringObjectFunction< T >

Definition at line 15 of file StringObjectFunction.h.


Constructor & Destructor Documentation

template<typename T>
StringObjectFunction< T >::StringObjectFunction ( const std::string &  expr  )  [inline]

Definition at line 16 of file StringObjectFunction.h.

00016                                                : 
00017     type_(ROOT::Reflex::Type::ByTypeInfo(typeid(T))) {
00018     if(! reco::parser::expressionParser<T>(expr, expr_)) {
00019       throw edm::Exception(edm::errors::Configuration,
00020                            "failed to parse \"" + expr + "\"");
00021     }
00022   }

template<typename T>
StringObjectFunction< T >::StringObjectFunction ( const reco::parser::ExpressionPtr expr  )  [inline]

Definition at line 23 of file StringObjectFunction.h.

00023                                                              : 
00024     expr_(expr),
00025     type_(ROOT::Reflex::Type::ByTypeInfo(typeid(T))) {
00026   }


Member Function Documentation

template<typename T>
double StringObjectFunction< T >::operator() ( const T &  t  )  const [inline]

Definition at line 27 of file StringObjectFunction.h.

00027                                        {
00028     using namespace ROOT::Reflex;
00029     Object o(type_, const_cast<T *>(& t));
00030     return expr_->value(o);  
00031   }


Member Data Documentation

template<typename T>
reco::parser::ExpressionPtr StringObjectFunction< T >::expr_ [private]

Definition at line 34 of file StringObjectFunction.h.

Referenced by StringObjectFunction< reco::Candidate >::operator()(), and StringObjectFunction< reco::Candidate >::StringObjectFunction().

template<typename T>
ROOT::Reflex::Type StringObjectFunction< T >::type_ [private]

Definition at line 35 of file StringObjectFunction.h.

Referenced by StringObjectFunction< reco::Candidate >::operator()().


The documentation for this struct was generated from the following file:
Generated on Tue Jun 9 18:32:56 2009 for CMSSW by  doxygen 1.5.4