EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbProxy.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDbProxy.h
1 
2 #ifndef FAIRDBPROXY_H
3 #define FAIRDBPROXY_H
4 
5 
6 #include <string>
7 using std::string;
8 #include <list>
9 #include <vector>
10 
11 #include "FairDb.h"
12 
14 class FairDbResultSet;
16 class FairDbTableProxy;
17 class ValContext;
18 class ValTimeStamp;
19 
21 {
22 
23  public:
24 
25 #ifndef __CINT__
26  typedef const std::vector<UInt_t> SeqList_t;
27 #endif
28 
29 // Constructors.
31  const string& tableName,
32  const FairDbTableMetaData* metaData,
33  const FairDbTableMetaData* metaValid,
34  const FairDbTableProxy* tableProxy);
35  virtual ~FairDbProxy();
36  UInt_t GetNumDb() const;
37  const string& GetTableName() const { return fTableNameUc; }
38  const FairDbTableProxy* GetTableProxy() const { return fTableProxy; }
39  void StoreMetaData(FairDbTableMetaData& metaData) const;
40  Bool_t TableExists(Int_t selectDbNo=-1) const;
41  void FindTimeBoundaries(const ValContext& vc,
42  const FairDb::Task& task,
43  UInt_t dbNo,
44  ValTimeStamp earliestCreate,
46  ValTimeStamp& end) const;
47  FairDbResultSet* QueryAllValidities(UInt_t dbNo,UInt_t seqNo=0) const;
48  FairDbResultSet* QuerySeqNo(UInt_t seqNo,UInt_t dbNo) const;
49 #ifndef __CINT__
50 
52  UInt_t dbNo,
53  const string& sqlData = "",
54  const string& fillOpts = "") const;
55 #endif
57  const FairDb::Task& task,
58  UInt_t dbNo) const;
59  FairDbResultSet* QueryValidity(const string& context,
60  const FairDb::Task& task,
61  UInt_t dbNo) const;
62  FairDbResultSet* QueryValidity(UInt_t seqNo,
63  UInt_t dbNo) const;
64 
65  // Store (output) member functions
66  Bool_t ReplaceInsertDate(const ValTimeStamp& ts,
67  UInt_t SeqNo,
68  UInt_t dbNo) const;
69  Bool_t RemoveSeqNo(UInt_t seqNo,
70  UInt_t dbNo) const;
71  Bool_t ReplaceSeqNo(UInt_t oldSeqNo,
72  UInt_t newSeqNo,
73  UInt_t dbNo) const;
74 
75  // State changing member functions
76  void SetSqlCondition(const string& sql) {
77  fSqlCondition = sql;
78  }
79 
80  private:
81 
82  Bool_t ReplaceSeqNoOracle(UInt_t oldSeqNo,
83  UInt_t newSeqNo,
84  UInt_t dbNo) const;
85  FairDbProxy(const FairDbProxy&);
87 
88 
92  string fSqlCondition;
93  string fTableName;
94  string fTableNameUc;
96  string fValSuffix;
97 
98  ClassDef(FairDbProxy,0) // Proxy for physical database.
99 
100 };
101 
102 #endif // FAIRDBPROXY_H