EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbTableProxyRegistry.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDbTableProxyRegistry.h
1 #ifndef FAIRDBTABLEPROXYREGISTRY_H
2 #define FAIRDBTABLEPROXYREGISTRY_H
3 
4 
5 #if !defined(__CINT__) || defined(__MAKECINT__)
6 #include "Rtypes.h"
7 #endif
8 #include <map>
9 #include <string>
10 #include <cstdlib>
11 
12 #include "FairDbConfigurable.h"
14 #include "FairDbRollbackDates.h"
15 
16 
18 class FairDbTableProxy;
19 class FairDbTableRow;
20 
22 {
23 
24  public:
25 
26 // State testing member functions
27  void ShowStatistics() const;
28 
29 // State changing member functions
31  static Bool_t IsActive() { return fgInstance ? kTRUE: kFALSE; }
32 
33  void Config();
34  void ClearRollbackDates();
37  FairDbTableProxy& GetTableProxy(const std::string& tableName,
38  const FairDbTableRow* tableRow) ;
39  Bool_t HasRowCounter(const std::string& tableName);
40  void PurgeCaches();
41  void RefreshMetaData(const std::string& tableName);
42  void SetSqlCondition(const std::string& sql="");
43 
44  protected:
45 
46 // Constructors (protected because singleton).
48  virtual ~FairDbTableProxyRegistry();
49 
50  private:
51 
53 
54  public:
55 
56  struct Cleaner {
57  static int fgCount; // counts #includes
58  Cleaner() { this->Increment(); }
63  }
64  }
65  void Increment() { ++fgCount; };
66  };
67  friend class Cleaner;
68 
69 
72 
73 
74  private:
75 
76 
79 
80 // State testing member functions
81  void ApplySqlCondition() const;
82  void ApplySqlCondition(FairDbTableProxy* proxy) const;
83 
84 // Data members
85 
86 
88  std::string fSqlCondition;
89 
90 #ifndef __CINT__ // Hide map from CINT; complains: missing Streamer() etc.
91 
92  std::map<std::string,FairDbTableProxy*> fTPmap;
93 #endif // __CINT__
94 
97 
100 
101 
104 
105  ClassDef(FairDbTableProxyRegistry,0) // Singleton register FairDbTableProxys.
106 
107 };
108 
109 #ifndef __CINT__
110 
112 #endif
113 
114 #endif // FAIRDBTABLEPROXYREGISTRY_H