test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExpressionVar.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_ExpressionVar_h
2 #define CommonTools_Utils_ExpressionVar_h
3 /* \class reco::parser::ExpressionVar
4  *
5  * Variable expression
6  *
7  * \author original version: Chris Jones, Cornell,
8  * adapted by Luca Lista, INFN
9  *
10  * \version $Revision: 1.6 $
11  *
12  */
16 #include <vector>
17 
18 namespace reco {
19  namespace parser {
21  struct ExpressionVar : public ExpressionBase {
22  ExpressionVar(const std::vector<MethodInvoker> & methods, method::TypeCode retType);
23 
24  ~ExpressionVar() ;
25  ExpressionVar(const ExpressionVar &var) ;
26 
27  virtual double value(const edm::ObjectWithDict & o) const;
28 
33 
37  static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType) ;
40  static void delStorage(edm::ObjectWithDict &obj);
41 
42  private:
43  std::vector<MethodInvoker> methods_;
44  mutable std::vector<edm::ObjectWithDict> objects_;
45  mutable std::vector<bool> needsDestructor_;
47  void initObjects_();
48  };
49 
53  ExpressionLazyVar(const std::vector<LazyInvoker> & methods);
55 
56  virtual double value(const edm::ObjectWithDict & o) const;
57 
58  private:
59  std::vector<LazyInvoker> methods_;
60  mutable std::vector<edm::ObjectWithDict> objects_;
61  };
62 
63  }
64 }
65 
66 #endif
type
Definition: HCALResponse.h:21
virtual double value(const edm::ObjectWithDict &o) const
ExpressionLazyVar(const std::vector< LazyInvoker > &methods)
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
static void delStorage(edm::ObjectWithDict &obj)
std::vector< LazyInvoker > methods_
Definition: ExpressionVar.h:59
ExpressionVar(const std::vector< MethodInvoker > &methods, method::TypeCode retType)
std::vector< bool > needsDestructor_
Definition: ExpressionVar.h:45
static bool isValidReturnType(method::TypeCode)
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
virtual double value(const edm::ObjectWithDict &o) const
std::vector< edm::ObjectWithDict > objects_
Definition: ExpressionVar.h:60
std::vector< MethodInvoker > methods_
Definition: ExpressionVar.h:43
std::vector< edm::ObjectWithDict > objects_
Definition: ExpressionVar.h:44
Evaluate an object&#39;s method or datamember (or chain of them) to get a number.
Definition: ExpressionVar.h:21
method::TypeCode retType_
Definition: ExpressionVar.h:46