ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoModel
GeoSpecialShapes
src
LArWheelCalculator_Impl
RDBParamRecords.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Helper class to simplify parameter reading
6
7
#include "
RDBParamRecords.h
"
8
#include "
RDBParamReader.h
"
9
10
#include "
RDBAccessSvc/IRDBRecord.h
"
11
#include "
RDBAccessSvc/IRDBRecordset.h
"
12
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
13
14
RDBParamRecords::RDBParamRecords
(
RDBParamReader
* rdbParAcc,
IRDBRecordset_ptr
initRecSet)
15
:
m_rdbParAcc
(rdbParAcc),
16
m_RecSet
(
std
::move(initRecSet))
17
{
18
}
19
20
RDBParamRecords::RDBParamRecords
(
const
RDBParamRecords
& other)
21
:
m_rdbParAcc
(other.
m_rdbParAcc
),
22
m_RecSet
(other.
m_RecSet
)
23
{
24
}
25
26
27
RDBParamRecords::~RDBParamRecords
()
28
{
29
}
30
31
RDBParamRecords::self_t
&
RDBParamRecords::fallback_to
(
const
std::string&
node
,
32
const
std::string& tag,
33
const
std::string& tag2node)
34
{
35
if
(
m_RecSet
->size() == 0) {
36
m_RecSet
=
m_rdbParAcc
->_getRecordsetPtr(
node
, tag, tag2node);
37
}
38
return
*
this
;
39
}
40
41
const
RDBParamRecords::self_t
&
RDBParamRecords::param
(
int
&outval,
42
const
std::string& name,
43
unsigned
int
index
)
const
44
{
45
outval = (*m_RecSet)[
index
]->getInt(name);
46
return
*
this
;
47
}
48
49
const
RDBParamRecords::self_t
&
RDBParamRecords::param
(
unsigned
int
&outval,
50
const
std::string& name,
51
unsigned
int
index
)
const
52
{
53
outval = (
unsigned
int)(*
m_RecSet
)[
index
]->getInt(name);
54
return
*
this
;
55
}
56
57
const
RDBParamRecords::self_t
&
RDBParamRecords::param
(
double
&outval,
58
const
std::string& name,
59
const
double
units,
60
unsigned
int
index
)
const
61
{
62
outval = (*m_RecSet)[
index
]->getDouble(name)*units;
63
return
*
this
;
64
}
65
66
const
RDBParamRecords::self_t
&
RDBParamRecords::param
(std::string &outval,
67
const
std::string& name,
68
unsigned
int
index
)
const
69
{
70
outval = (*m_RecSet)[
index
]->getString(name);
71
return
*
this
;
72
}
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition
IRDBAccessSvc.h:30
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
RDBParamReader.h
RDBParamRecords.h
RDBParamReader
Helper class to simplify parameter reading Fully independent from other parts of package.
Definition
RDBParamReader.h:16
RDBParamRecords::RDBParamRecords
RDBParamRecords(RDBParamReader *rdbParAcc, IRDBRecordset_ptr initRecSet)
Definition
RDBParamRecords.cxx:14
RDBParamRecords::m_RecSet
IRDBRecordset_ptr m_RecSet
Definition
RDBParamRecords.h:33
RDBParamRecords::fallback_to
self_t & fallback_to(const std::string &node, const std::string &tag, const std::string &tag2node="")
Definition
RDBParamRecords.cxx:31
RDBParamRecords::param
const self_t & param(unsigned int &outval, const std::string &name, unsigned int index=0) const
Definition
RDBParamRecords.cxx:49
RDBParamRecords::self_t
RDBParamRecords self_t
Definition
RDBParamRecords.h:19
RDBParamRecords::m_rdbParAcc
RDBParamReader * m_rdbParAcc
Definition
RDBParamRecords.h:32
RDBParamRecords::~RDBParamRecords
~RDBParamRecords()
Definition
RDBParamRecords.cxx:27
node
Definition
node.h:24
index
Definition
index.py:1
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0