ATLAS Offline Software
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 
13 
15  : m_rdbParAcc(rdbParAcc),
16  m_RecSet(initRecSet)
17 {
18 }
19 
21  : m_rdbParAcc (other.m_rdbParAcc),
22  m_RecSet (other.m_RecSet)
23 {
24 }
25 
26 
28 {
29 }
30 
32  const std::string& tag,
33  const std::string& tag2node)
34 {
35  if(m_RecSet->size() == 0) {
37  }
38  return *this;
39 }
40 
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 
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 }
RDBParamRecords::~RDBParamRecords
~RDBParamRecords()
Definition: RDBParamRecords.cxx:27
RDBParamRecords.h
RDBParamReader::_getRecordsetPtr
IRDBRecordset_ptr _getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="")
Definition: RDBParamReader.cxx:30
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
index
Definition: index.py:1
RDBParamReader
Definition: RDBParamReader.h:16
RDBParamRecords
Definition: RDBParamRecords.h:16
RDBParamRecords::m_RecSet
IRDBRecordset_ptr m_RecSet
Definition: RDBParamRecords.h:33
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
RDBParamRecords::param
const self_t & param(unsigned int &outval, const std::string &name, unsigned int index=0) const
Definition: RDBParamRecords.cxx:49
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
RDBParamRecords::fallback_to
self_t & fallback_to(const std::string &node, const std::string &tag, const std::string &tag2node="")
Definition: RDBParamRecords.cxx:31
RDBParamRecords::RDBParamRecords
RDBParamRecords(RDBParamReader *rdbParAcc, IRDBRecordset_ptr initRecSet)
Definition: RDBParamRecords.cxx:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
RDBParamReader.h
perfmonmt-refit.units
string units
Definition: perfmonmt-refit.py:77
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
RDBParamRecords::m_rdbParAcc
RDBParamReader * m_rdbParAcc
Definition: RDBParamRecords.h:32
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
node
Definition: memory_hooks-stdcmalloc.h:74