CMS 3D CMS Logo

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 
39 
43  static bool makeStorage(edm::ObjectWithDict& obj, const edm::TypeWithDict& retType);
44 
47  static void delStorage(edm::ObjectWithDict&);
48 
49  public: // Public Methods
50  ExpressionVar(const std::vector<MethodInvoker>& methods, method::TypeCode retType);
52  ~ExpressionVar() override;
53  double value(const edm::ObjectWithDict&) const override;
54  };
55 
59  private: // Private Data Members
60  std::vector<LazyInvoker> methods_;
61  mutable std::vector<edm::ObjectWithDict> objects_;
62 
63  public:
64  ExpressionLazyVar(const std::vector<LazyInvoker>& methods);
65  ~ExpressionLazyVar() override;
66  double value(const edm::ObjectWithDict&) const override;
67  };
68 
69  } // namespace parser
70 } // namespace reco
71 
72 #endif // CommonTools_Utils_ExpressionVar_h
reco::parser::ExpressionLazyVar::methods_
std::vector< LazyInvoker > methods_
Definition: ExpressionVar.h:60
reco::parser::ExpressionVar::needsDestructor_
std::vector< bool > needsDestructor_
Definition: ExpressionVar.h:27
edm::ObjectWithDict
Definition: ObjectWithDict.h:17
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
TypeCode.h
reco::parser::ExpressionVar::initObjects_
void initObjects_()
Definition: ExpressionVar.cc:15
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
ExpressionBase.h
reco::parser::ExpressionVar::~ExpressionVar
~ExpressionVar() override
Definition: ExpressionVar.cc:38
reco::parser::ExpressionVar::ExpressionVar
ExpressionVar(const std::vector< MethodInvoker > &methods, method::TypeCode retType)
Definition: ExpressionVar.cc:29
reco::parser::ExpressionLazyVar::ExpressionLazyVar
ExpressionLazyVar(const std::vector< LazyInvoker > &methods)
Definition: ExpressionVar.cc:191
reco::parser::ExpressionVar::methods_
std::vector< MethodInvoker > methods_
Definition: ExpressionVar.h:25
reco::parser::ExpressionBase
Definition: ExpressionBase.h:21
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
edm::TypeWithDict
Definition: TypeWithDict.h:38
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
reco::parser::ExpressionVar
Evaluate an object's method or datamember (or chain of them) to get a number.
Definition: ExpressionVar.h:23
MethodInvoker.h
reco::method::TypeCode
TypeCode
Definition: TypeCode.h:13
reco::parser::ExpressionLazyVar::value
double value(const edm::ObjectWithDict &) const override
Definition: ExpressionVar.cc:195
reco::parser::ExpressionVar::objToDouble
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
Definition: ExpressionVar.cc:142
reco::parser::ExpressionVar::delStorage
static void delStorage(edm::ObjectWithDict &)
Definition: ExpressionVar.cc:45
reco::parser::ExpressionLazyVar
Definition: ExpressionVar.h:58
reco::parser::ExpressionVar::makeStorage
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
Definition: ExpressionVar.cc:60
reco::parser::ExpressionVar::objects_
std::vector< edm::ObjectWithDict > objects_
Definition: ExpressionVar.h:26
reco::parser::ExpressionVar::retType_
method::TypeCode retType_
Definition: ExpressionVar.h:28
reco::parser::ExpressionLazyVar::objects_
std::vector< edm::ObjectWithDict > objects_
Definition: ExpressionVar.h:61
reco::parser::ExpressionLazyVar::~ExpressionLazyVar
~ExpressionLazyVar() override
Definition: ExpressionVar.cc:193
reco::parser::ExpressionVar::isValidReturnType
static bool isValidReturnType(method::TypeCode)
Definition: ExpressionVar.cc:78
reco::parser::ExpressionVar::value
double value(const edm::ObjectWithDict &) const override
Definition: ExpressionVar.cc:125