Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OnlMonDBodbc.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file OnlMonDBodbc.h
1 #ifndef ONLMONDBODBC_H__
2 #define ONLMONDBODBC_H__
3 
4 #include <onlmon/OnlMonBase.h>
5 
6 #include <ctime>
7 #include <map>
8 #include <string>
9 #include <vector>
10 
11 class OnlMonDBVar;
12 namespace odbc
13 {
14  class ResultSet;
15 }
16 
17 class OnlMonDBodbc : public OnlMonBase
18 {
19  public:
20  OnlMonDBodbc(const std::string &tablename);
21  virtual ~OnlMonDBodbc();
22  void Dump();
23  int Info(const char *tablename = nullptr);
24  int CreateTable();
25  int CheckAndCreateTable(const std::map<const std::string, OnlMonDBVar *> &varmap);
26  int DropTable(const std::string &name);
27  void identify() const;
28  int AddRow(const time_t ticks, const int runnumber, const std::map<const std::string, OnlMonDBVar *> &varmap);
29  int GetVar(const time_t begin, const time_t end, const std::string &varname, std::vector<time_t> &timestp, std::vector<int> &runnumber, std::vector<float> &var, std::vector<float> &varerr);
30 
31  private:
32  void Dump(odbc::ResultSet *rs) const;
33  int GetConnection();
38 };
39 
40 #endif