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 to Reflex by Luca Lista, INFN
9  *
10  * \version $Revision: 1.4 $
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 Reflex::Object & o) const;
28 
32  static double objToDouble(const Reflex::Object &obj, method::TypeCode type) ;
33 
37  static bool makeStorage(Reflex::Object &obj, const Reflex::Member &member) ;
40  static void delStorage(Reflex::Object &obj);
41 
42  private:
43  std::vector<MethodInvoker> methods_;
44  mutable std::vector<Reflex::Object> objects_;
45  mutable std::vector<bool> needsDestructor_;
47  static void trueDelete(Reflex::Object & o) ;
48  void initObjects_();
49  };
50 
54  ExpressionLazyVar(const std::vector<LazyInvoker> & methods);
56 
57  virtual double value(const Reflex::Object & o) const;
58 
59  private:
60  std::vector<LazyInvoker> methods_;
61  mutable std::vector<Reflex::Object> objects_;
62  };
63 
64  }
65 }
66 
67 #endif
type
Definition: HCALResponse.h:22
ExpressionLazyVar(const std::vector< LazyInvoker > &methods)
virtual double value(const Reflex::Object &o) const
std::vector< Reflex::Object > objects_
Definition: ExpressionVar.h:61
static void delStorage(Reflex::Object &obj)
std::vector< LazyInvoker > methods_
Definition: ExpressionVar.h:60
ExpressionVar(const std::vector< MethodInvoker > &methods, method::TypeCode retType)
std::vector< bool > needsDestructor_
Definition: ExpressionVar.h:45
static bool isValidReturnType(method::TypeCode)
std::vector< Reflex::Object > objects_
Definition: ExpressionVar.h:44
static void trueDelete(Reflex::Object &o)
virtual double value(const Reflex::Object &o) const
std::vector< MethodInvoker > methods_
Definition: ExpressionVar.h:43
static bool makeStorage(Reflex::Object &obj, const Reflex::Member &member)
static double objToDouble(const Reflex::Object &obj, method::TypeCode type)
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