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 
4 /* \class reco::parser::ExpressionVar
5  *
6  * Variable expression
7  *
8  * \author original version: Chris Jones, Cornell,
9  * adapted by Luca Lista, INFN
10  *
11  */
12 
16 
17 #include <vector>
18 
19 namespace reco {
20 namespace parser {
21 
23 class ExpressionVar : public ExpressionBase {
24 private: // Private Data Members
25  std::vector<MethodInvoker> methods_;
26  mutable std::vector<edm::ObjectWithDict> objects_;
27  mutable std::vector<bool> needsDestructor_;
29 
30 private: // Private Methods
31  void initObjects_();
32 
33 public: // Public Static Methods
35 
38  static double objToDouble(const edm::ObjectWithDict& obj,
40 
44  static bool makeStorage(edm::ObjectWithDict& obj,
45  const edm::TypeWithDict& retType);
46 
49  static void delStorage(edm::ObjectWithDict&);
50 
51 public: // Public Methods
52  ExpressionVar(const std::vector<MethodInvoker>& methods,
53  method::TypeCode retType);
56  virtual double value(const edm::ObjectWithDict&) const;
57 };
58 
62 private: // Private Data Members
63  std::vector<LazyInvoker> methods_;
64  mutable std::vector<edm::ObjectWithDict> objects_;
65 public:
66  ExpressionLazyVar(const std::vector<LazyInvoker>& methods);
68  virtual double value(const edm::ObjectWithDict&) const;
69 };
70 
71 } // namespace parser
72 } // namespace reco
73 
74 #endif // CommonTools_Utils_ExpressionVar_h
type
Definition: HCALResponse.h:21
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
std::vector< edm::ObjectWithDict > objects_
Definition: ExpressionVar.h:26
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
virtual double value(const edm::ObjectWithDict &) const
method::TypeCode retType_
Definition: ExpressionVar.h:28
ExpressionLazyVar(const std::vector< LazyInvoker > &methods)
ExpressionVar(const std::vector< MethodInvoker > &methods, method::TypeCode retType)
static bool isValidReturnType(method::TypeCode)
std::vector< MethodInvoker > methods_
Definition: ExpressionVar.h:25
static void delStorage(edm::ObjectWithDict &)
virtual double value(const edm::ObjectWithDict &) const
Evaluate an object&#39;s method or datamember (or chain of them) to get a number.
Definition: ExpressionVar.h:23
std::vector< edm::ObjectWithDict > objects_
Definition: ExpressionVar.h:64
std::vector< bool > needsDestructor_
Definition: ExpressionVar.h:27
std::vector< LazyInvoker > methods_
Definition: ExpressionVar.h:63