VarExtractorBase.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
8 
9 namespace VLN {
10 
12 {
13 public:
15  const std::string &prefix,
16  const std::vector<std::string> &scalarVars,
17  const std::vector<std::string> &vectorVars
18  );
19  virtual ~VarExtractorBase() = default;
20  virtual void extract(const art::Event &evt, VarDict &vars);
21 
22 protected:
23  virtual void extractVars(const art::Event &evt, VarDict &vars) = 0;
24 
25  void setScalarVar(
26  VarDict &vars, const std::string &name, double value
27  ) const;
28 
29  void appendToVectorVar(
30  VarDict &vars, const std::string &name, double value
31  ) const;
32 
33  void initScalarVars(
34  VarDict &vars, const std::vector<std::string> &names
35  ) const;
36 
37  void initVectorVars(
38  VarDict &vars, const std::vector<std::string> &names
39  ) const;
40 
41 protected:
43 
44  std::vector<std::string> scalarVars;
45  std::vector<std::string> vectorVars;
46 };
47 
48 }
49 
static QCString name
Definition: declinfo.cpp:673
virtual ~VarExtractorBase()=default
std::string string
Definition: nybbler.cc:12
virtual void extractVars(const art::Event &evt, VarDict &vars)=0
Definition: VarDict.h:8
virtual void extract(const art::Event &evt, VarDict &vars)
std::vector< std::string > vectorVars
void appendToVectorVar(VarDict &vars, const std::string &name, double value) const
Definition: utils.cxx:6
std::vector< std::string > scalarVars
void setScalarVar(VarDict &vars, const std::string &name, double value) const
void initScalarVars(VarDict &vars, const std::vector< std::string > &names) const
void initVectorVars(VarDict &vars, const std::vector< std::string > &names) const
VarExtractorBase(const std::string &prefix, const std::vector< std::string > &scalarVars, const std::vector< std::string > &vectorVars)
TCEvent evt
Definition: DataStructs.cxx:7
static std::vector< std::string > const names
Definition: FragmentType.hh:8