Belle II Software  release-05-02-19
DBRecord.h
1 #ifndef _Belle2_DBRecord_h
2 #define _Belle2_DBRecord_h
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 
8 namespace Belle2 {
14  typedef std::map<std::string, std::string> DBFieldList;
15 
16  class DBRecord {
17 
18  public:
19  DBRecord() {};
20  ~DBRecord() {};
21 
22  public:
23  std::vector<std::string>& getFieldNames() { return m_name_v; }
24  DBFieldList& getFieldValues() { return m_value_m; }
25  bool hasField(const std::string& name)
26  {
27  return m_value_m.find(name) != m_value_m.end();
28  }
29  size_t getNFields() const { return m_name_v.size(); }
30  const std::string get(const std::string& name) const;
31  const std::string get(int i) const;
32  unsigned long long int getULLInt(const std::string& name) const;
33  int getInt(const std::string& name) const;
34  int getInt(int i) const;
35  bool getBool(const std::string& name) const;
36  bool getBool(int i) const;
37  float getFloat(const std::string& name) const;
38  float getFloat(int i) const;
39  std::vector<std::string> getArray(const std::string& name) const;
40  std::vector<std::string> getArray(int i) const;
41  std::vector<int> getIntArray(const std::string& name) const;
42  std::vector<int> getIntArray(int i) const;
43  std::vector<float> getFloatArray(const std::string& name) const;
44  std::vector<float> getFloatArray(int i) const;
45  const std::string getFieldName(int i) const;
46  void reset();
47  void add(std::string name, std::string value);
48 
49  private:
50  std::vector<std::string> m_name_v;
51  mutable DBFieldList m_value_m;
52 
53  };
54 
55  typedef std::vector<DBRecord> DBRecordList;
56 
58 }
59 
60 #endif
Belle2::DBRecord
Definition: DBRecord.h:16
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19