Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:56

0001 #ifndef ONLMONDBODBC_H__
0002 #define ONLMONDBODBC_H__
0003 
0004 #include <onlmon/OnlMonBase.h>
0005 
0006 #include <ctime>
0007 #include <map>
0008 #include <string>
0009 #include <vector>
0010 
0011 class OnlMonDBVar;
0012 namespace odbc
0013 {
0014   class ResultSet;
0015 }
0016 
0017 class OnlMonDBodbc : public OnlMonBase
0018 {
0019  public:
0020   OnlMonDBodbc(const std::string &tablename);
0021   virtual ~OnlMonDBodbc();
0022   void Dump();
0023   int Info(const char *tablename = nullptr);
0024   int CreateTable();
0025   int CheckAndCreateTable(const std::map<const std::string, OnlMonDBVar *> &varmap);
0026   int DropTable(const std::string &name);
0027   void identify() const;
0028   int AddRow(const time_t ticks, const int runnumber, const std::map<const std::string, OnlMonDBVar *> &varmap);
0029   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);
0030 
0031  private:
0032   void Dump(odbc::ResultSet *rs) const;
0033   int GetConnection();
0034   std::string dbname;
0035   std::string dbowner;
0036   std::string dbpasswd;
0037   std::string table;
0038 };
0039 
0040 #endif