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
FairDbConfigurable.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FairDbConfigurable.cxx
1
#include "
FairDbConfigurable.h
"
2
#include "
FairDbConf.h
"
3
#include "
FairDbConfDialog.h
"
4
#include "
FairDb.h
"
5
6
ClassImp
(
FairDbConfigurable
)
7
8
//......................................................................
9
10
FairDbConfigurable
::
FairDbConfigurable
() : fDefConfig(), fConfig(
false
) { }
11
12
//......................................................................
13
14
FairDbConfigurable::~FairDbConfigurable
() { }
15
16
//......................................................................
17
18
void
FairDbConfigurable::CommitDefaultConfig
(
const
FairRegistry
& r)
19
{
24
fDefConfig
= r;
25
}
26
27
//......................................................................
28
29
const
FairRegistry
&
FairDbConfigurable::DefaultConfig
()
const
30
{
35
return
fDefConfig
;
36
}
37
38
FairRegistry
&
FairDbConfigurable::GetConfig
()
39
{
44
return
fConfig
;
45
}
46
47
const
FairRegistry
&
FairDbConfigurable::GetConfig
()
const
48
{
54
return
fConfig
;
55
}
56
57
//......................................................................
58
59
int
FairDbConfigurable::Update
()
60
{
66
if
(!
fConfig
.
IsDirty
()) {
return
0; }
// Nothing to do if config is current
67
this->
Config
();
// Send the "reconfig" message
68
fConfig
.
SetDirty
(
false
);
// Mark the config. as current
69
return
1;
70
}
71
72
//......................................................................
73
74
void
FairDbConfigurable::Set
(
FairDbConfDialog
*
d
)
75
{
76
//======================================================================
77
// Update the configuration parameters. Allow a FairDbDialog object to be
78
// passed in. If none is passed in use the default, text based dialog
79
// object.
80
//======================================================================
81
bool
deleteDialog =
false
;
82
if
(d==0) {
83
d =
new
FairDbConfDialog
();
84
deleteDialog =
true
;
85
}
86
87
// Set up d with the default configuration parameters
88
d->
SetDefault
(this->
DefaultConfig
());
89
d->
SetCurrent
(this->
GetConfig
());
90
91
// Do the querry
92
FairRegistry
r = d->
Query
();
93
this->
GetConfig
().
UnLockValues
();
94
this->
GetConfig
().
Merge
(r);
95
this->
GetConfig
().
LockValues
();
96
97
// Clean up the dialog
98
if
(deleteDialog) {
delete
d
; d = 0; }
99
}
100
101
//......................................................................
102
103
void
FairDbConfigurable::Set
(
const
char
*
s
)
104
{
109
FairRegistry
r;
110
FairDbConf::StringToRegistry
(r,s);
111
this->
GetConfig
().
UnLockValues
();
112
this->
GetConfig
().
Merge
(r);
113
this->
GetConfig
().
LockValues
();
114
}
115
EicRoot
blob
master
dbase
dbInterface
FairDbConfigurable.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:33
using
1.8.2 with
EIC GitHub integration