EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDetParTSQLIo.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDetParTSQLIo.h
1 /***************************************
2  * Author: M.Babai (M.Babai@rug.nl) *
3  * License: *
4  * Version: *
5  ***************************************/
6 #pragma once
7 #ifndef FAIRDET_PAR_TSQL_IO_H
8 #define FAIRDET_PAR_TSQL_IO_H
9 
10 //C && C++
11 #include <iostream>
12 
13 // FairRoot
14 #include "FairDetParIo.h"
15 
16 class FairRun;
17 class FairRuntimeDb;
19 class FairRtdbRun;
20 class FairParSet;
21 
23 {
24  // ____________ public Members ___________________
25  public:
28 
37  FairDetParTSQLIo(FairDbMultConnector const& cons, int const dbNum = -1);
38 
40  virtual ~FairDetParTSQLIo();
41 
45  Bool_t read (FairParSet* pars);
46 
47  // Write to database
48  Int_t write(FairParSet* pars);
49 
50  // Get start time for the current run
51  Int_t getRunStart(FairParSet* pPar = 0);
52 
53  //________ DB functions maybe later ____
54  // It depends on the used DBMS. We need to see if this is needed.
55  // commits changes.
56  virtual void commit();
57 
58  // Undo the changes made since last commit.
59  virtual void rollback();
60 
62  inline void print();
64 
65  // ____________ protected Members ___________________
66  protected:
67 
72  int actRunId; // actual runId (can be -1 if there are no data in Oracle)
73 
74  void setChanged(FairParSet* pars);
75 
76  // ____________ private Members ___________________
77  private:
78  //To avoid mistakes.
81 
82  ClassDef(FairDetParTSQLIo, 0)
83 };
84 
86 #ifndef __CINT__
88 {
89  std::cout << "FairDetParTSQLIo::print()\n\n";
90 };
91 #endif /* __CINT__ */
92 #endif