EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
"
13
#include "
FairDbSimFlagAssociation.h
"
14
#include "
FairDbRollbackDates.h
"
15
16
17
class
FairDbMultConnector
;
18
class
FairDbTableProxy
;
19
class
FairDbTableRow
;
20
21
class
FairDbTableProxyRegistry
:
public
FairDbConfigurable
22
{
23
24
public
:
25
26
// State testing member functions
27
void
ShowStatistics
()
const
;
28
29
// State changing member functions
30
static
FairDbTableProxyRegistry
&
Instance
();
31
static
Bool_t
IsActive
() {
return
fgInstance
? kTRUE: kFALSE; }
32
33
void
Config
();
34
void
ClearRollbackDates
();
35
void
ClearSimFlagAssociation
();
36
FairDbMultConnector
&
GetMultConnector
() {
return
*
fMultConnector
; }
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).
47
FairDbTableProxyRegistry
();
48
virtual
~FairDbTableProxyRegistry
();
49
50
private
:
51
52
void
SetConfigFromEnvironment
();
53
54
public
:
55
56
struct
Cleaner
{
57
static
int
fgCount
;
// counts #includes
58
Cleaner
() { this->
Increment
(); }
59
~Cleaner
() {
60
if
(--
fgCount
==0 &&
FairDbTableProxyRegistry::fgInstance
!=0) {
61
delete
FairDbTableProxyRegistry::fgInstance
;
62
FairDbTableProxyRegistry::fgInstance
= 0;
63
}
64
}
65
void
Increment
() { ++
fgCount
; };
66
};
67
friend
class
Cleaner
;
68
69
71
FairDbMultConnector
*
fMultConnector
;
72
73
74
private
:
75
76
77
FairDbTableProxyRegistry
(
const
FairDbTableProxyRegistry
&);
78
FairDbTableProxyRegistry
&
operator=
(
const
FairDbTableProxyRegistry
&);
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
96
FairDbRollbackDates
fRollbackDates
;
97
99
FairDbSimFlagAssociation
fSimFlagAss
;
100
101
103
static
FairDbTableProxyRegistry
*
fgInstance
;
104
105
ClassDef(
FairDbTableProxyRegistry
,0)
// Singleton register FairDbTableProxys.
106
107
};
108
109
#ifndef __CINT__
110
111
static
struct
FairDbTableProxyRegistry::Cleaner
__dbi_cleaner
;
112
#endif
113
114
#endif // FAIRDBTABLEPROXYREGISTRY_H
EicRoot
blob
master
dbase
dbInterface
FairDbTableProxyRegistry.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:33
using
1.8.2 with
EIC GitHub integration