EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbTableProxy.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDbTableProxy.h
1 #ifndef FAIRDBTABLEPROXY_H
2 #define FAIRDBTABLEPROXY_H
3 
4 #include <string>
5 #include <sstream>
6 using std::string;
7 
8 #include "FairDb.h"
9 #include "FairDbProxy.h"
10 #include "FairDbTableMetaData.h"
11 #include "FairDbValidityRec.h"
12 #include "ValContext.h"
13 #include "ValTimeStamp.h"
14 
15 class FairDbCache;
17 class FairDbResult;
19 class FairDbTableRow;
20 class FairDbValidityRec;
22 
24 {
25 
27 
28  public:
29 
30 // State testing member functions
31  const FairDbProxy& GetDBProxy() const { return fDBProxy; }
33  const FairDbTableMetaData& GetMetaData() const { return fMetaData; }
34  const FairDbTableMetaData& GetMetaValid() const { return fMetaValid; }
35  string GetRowName() const {
36  return fTableRow ? fTableRow->ClassName() : "Unknown";
37  }
38  string GetTableName() const { return fTableName;}
39 // State changing member functions
40  FairDbCache* GetCache() { return fCache;}
41  const FairDbResult* Query(const ValContext& vc,
42  const FairDb::Task& task,
43  Bool_t findFullTimeWindow = true);
44  const FairDbResult* Query(const string& context,
45  const FairDb::Task& task,
46  const string& data,
47  const string& fillOpts);
48  const FairDbResult* Query(UInt_t seqNo,UInt_t dbNo);
49  const FairDbResult* Query(const FairDbValidityRec& vrec,
50  Bool_t canReuse = kTRUE);
52  UInt_t dbNo);
53  void RefreshMetaData();
54  void SetSqlCondition(const string& sql);
55  Bool_t TableExists() const { return fExists; }
56 
57  protected:
58 
59 // Constructors (protected because created and owned by FairDbTableProxyRegistry).
61  const string& tableName,
62  const string& vldSuffix,
63  const FairDbTableRow* tableRow);
64  virtual ~FairDbTableProxy();
65 
66  private:
67 
68 
71 
72 
73 // Level 2 (disk) cache management.
74  Bool_t CanReadL2Cache() const;
75  Bool_t CanWriteL2Cache() const;
76  Bool_t RestoreFromL2Cache(const FairDbValidityRecBuilder& builder);
77  Bool_t SaveToL2Cache(const string& name, FairDbResult& res);
78 
79 
83  Bool_t fCanL2Cache;
86  Bool_t fExists;
87  string fTableName;
89 
90  ClassDef(FairDbTableProxy,0) // Object to query a specific table.
91 
92 };
93 
94 
95 #endif // FAIRDBTABLEPROXY_H