ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
RDBAccessSvc
src
RDBRecord.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
14
15
#ifndef RDBACCESSSVC_RDBRECORD_H
16
#define RDBACCESSSVC_RDBRECORD_H
17
18
#include "CoralBase/AttributeList.h"
19
#include "
RDBAccessSvc/IRDBRecord.h
"
20
#include "
CxxUtils/checker_macros.h
"
21
#include <map>
22
#include <string>
23
#include <string_view>
24
#include <iosfwd>
25
26
namespace
coral
27
{
28
class
ICursor;
29
}
30
36
class
RDBRecord
final :
public
IRDBRecord
37
{
38
friend
class
RDBRecordset
;
39
40
public
:
41
42
RDBRecord
(
const
RDBRecord
&) =
delete
;
43
RDBRecord
&
operator=
(
const
RDBRecord
&) =
delete
;
44
46
~RDBRecord
()
override
;
47
51
bool
isFieldNull
(std::string_view fieldName)
const override
;
52
56
int
getInt
(std::string_view fieldName)
const override
;
57
61
long
getLong
(std::string_view fieldName)
const override
;
62
66
double
getDouble
(std::string_view fieldName)
const override
;
67
71
float
getFloat
(std::string_view fieldName)
const override
;
72
76
virtual
const
std::string&
getString
(std::string_view string_view)
const override
;
77
78
// Access array values by index
79
// arrays are implemented using the field with names like NAME_0, NAME_1 etc.
80
85
int
getInt
(std::string_view fieldName,
unsigned
int
index
)
const override
;
86
91
long
getLong
(std::string_view fieldName,
unsigned
int
index
)
const override
;
92
97
double
getDouble
(std::string_view fieldName,
unsigned
int
index
)
const override
;
98
103
float
getFloat
(std::string_view fieldName,
unsigned
int
index
)
const override
;
104
109
virtual
const
std::string&
getString
(std::string_view fieldName,
unsigned
int
index
)
const override
;
110
111
// Comparison operator
112
bool
operator!=
(
const
RDBRecord
& rhs)
const
;
113
114
// Dump record to output stream
115
std::ostream&
toOutputStream
(std::ostream& os)
const
;
116
117
protected
:
122
RDBRecord
(
const
coral::AttributeList& attList,
const
std::string& tableName);
123
124
private
:
125
typedef
std::map<std::string, unsigned int, std::less<>>
FieldName2ListIndex
;
126
128
RDBRecord
(){}
129
130
FieldName2ListIndex
m_name2Index
;
131
coral::AttributeList* m_values
ATLAS_THREAD_SAFE
;
132
133
std::string
m_tableName
;
134
135
template
<
typename
T>
136
const
T&
getGeneric
(std::string_view fieldName)
const
;
137
FieldName2ListIndex::const_iterator
getItr
(std::string_view fieldName)
const
;
138
FieldName2ListIndex::const_iterator
getItr
(std::string_view fieldName,
int
)
const
;
139
140
};
141
142
inline
std::ostream&
operator <<
(std::ostream& os,
const
RDBRecord
&
x
)
143
{
144
x
.toOutputStream(os);
145
return
os;
146
}
147
148
149
#endif
150
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
operator<<
std::ostream & operator<<(std::ostream &os, const RDBRecord &x)
Definition
RDBRecord.h:142
x
#define x
checker_macros.h
Define macros for attributes used to control the static checker.
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition
IRDBRecord.h:28
RDBRecord
RDBRecord is one record in the RDBRecordset object.
Definition
RDBRecord.h:37
RDBRecord::getLong
long getLong(std::string_view fieldName) const override
Get long field value.
Definition
RDBRecord.cxx:109
RDBRecord::operator!=
bool operator!=(const RDBRecord &rhs) const
Definition
RDBRecord.cxx:214
RDBRecord::RDBRecord
RDBRecord(const RDBRecord &)=delete
RDBRecord::FieldName2ListIndex
std::map< std::string, unsigned int, std::less<> > FieldName2ListIndex
Definition
RDBRecord.h:125
RDBRecord::operator=
RDBRecord & operator=(const RDBRecord &)=delete
RDBRecord::getInt
int getInt(std::string_view fieldName) const override
Get int field value.
Definition
RDBRecord.cxx:93
RDBRecord::getFloat
float getFloat(std::string_view fieldName) const override
Get float field value.
Definition
RDBRecord.cxx:133
RDBRecord::getGeneric
const T & getGeneric(std::string_view fieldName) const
Definition
RDBRecord.cxx:47
RDBRecord::toOutputStream
std::ostream & toOutputStream(std::ostream &os) const
Definition
RDBRecord.cxx:241
RDBRecord::RDBRecordset
friend class RDBRecordset
Definition
RDBRecord.h:38
RDBRecord::RDBRecord
RDBRecord()
Empty private constructor.
Definition
RDBRecord.h:128
RDBRecord::~RDBRecord
~RDBRecord() override
Destructor.
Definition
RDBRecord.cxx:41
RDBRecord::ATLAS_THREAD_SAFE
coral::AttributeList *m_values ATLAS_THREAD_SAFE
Definition
RDBRecord.h:131
RDBRecord::getString
virtual const std::string & getString(std::string_view string_view) const override
Get string field value.
Definition
RDBRecord.cxx:138
RDBRecord::m_tableName
std::string m_tableName
Definition
RDBRecord.h:133
RDBRecord::isFieldNull
bool isFieldNull(std::string_view fieldName) const override
Check if the field value is NULL.
Definition
RDBRecord.cxx:85
RDBRecord::getItr
FieldName2ListIndex::const_iterator getItr(std::string_view fieldName) const
Definition
RDBRecord.cxx:64
RDBRecord::getDouble
double getDouble(std::string_view fieldName) const override
Get double field value.
Definition
RDBRecord.cxx:128
RDBRecord::m_name2Index
FieldName2ListIndex m_name2Index
Definition
RDBRecord.h:130
coral
Definition
ISecondaryEventSelector.h:19
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0