RDBRecord is one record in the RDBRecordset object.
More...
#include <RDBRecord.h>
RDBRecord is one record in the RDBRecordset object.
Definition at line 34 of file RDBRecord.h.
◆ FieldName2ListIndex
◆ RDBRecord() [1/3]
◆ ~RDBRecord()
RDBRecord::~RDBRecord |
( |
| ) |
|
|
override |
◆ RDBRecord() [2/3]
RDBRecord::RDBRecord |
( |
const coral::AttributeList & |
attList, |
|
|
const std::string & |
tableName |
|
) |
| |
|
protected |
Constructor used by RDBRecordset class.
- Parameters
-
attList | [IN] pointer to the attribute list, source of the Record object |
cursor | [IN] need to check if the field values are NULL |
tableName | [IN] data table name in the database |
Definition at line 27 of file RDBRecord.cxx.
34 m_values->fastCopyData (attList);
36 for(
unsigned int i=0;
i<m_values->size();
i++) {
37 std::string
key = (*m_values)[
i].specification().name();
◆ RDBRecord() [3/3]
Empty private constructor.
Definition at line 126 of file RDBRecord.h.
◆ getDouble() [1/2]
double RDBRecord::getDouble |
( |
const std::string & |
fieldName | ) |
const |
|
overridevirtual |
Get double field value.
- Parameters
-
- Returns
- field value
Implements IRDBRecord.
Definition at line 99 of file RDBRecord.cxx.
107 if(
values[
it->second].specification().type()==
typeid(
double)) {
108 return values[
it->second].data<
double>();
111 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of double type");
◆ getDouble() [2/2]
double RDBRecord::getDouble |
( |
const std::string & |
fieldName, |
|
|
unsigned int |
index |
|
) |
| const |
|
overridevirtual |
Get array double field value.
- Parameters
-
fieldName | [IN] field name |
index | [IN] index in the array |
- Returns
- field value
Implements IRDBRecord.
Definition at line 185 of file RDBRecord.cxx.
193 if(
values[
it->second].specification().type()==
typeid(
double)) {
194 return values[
it->second].data<
double>();
197 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of double type");
◆ getFloat() [1/2]
float RDBRecord::getFloat |
( |
const std::string & |
fieldName | ) |
const |
|
overridevirtual |
Get float field value.
- Parameters
-
- Returns
- field value
Implements IRDBRecord.
Definition at line 115 of file RDBRecord.cxx.
123 if(
values[
it->second].specification().type()==
typeid(
float)) {
124 return values[
it->second].data<
float>();
127 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of float type");
◆ getFloat() [2/2]
float RDBRecord::getFloat |
( |
const std::string & |
fieldName, |
|
|
unsigned int |
index |
|
) |
| const |
|
overridevirtual |
Get array float field value.
- Parameters
-
fieldName | [IN] field name |
index | [IN] index in the array |
- Returns
- field value
Implements IRDBRecord.
Definition at line 201 of file RDBRecord.cxx.
209 if(
values[
it->second].specification().type()==
typeid(
float)) {
210 return values[
it->second].data<
float>();
213 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of float type");
◆ getInt() [1/2]
int RDBRecord::getInt |
( |
const std::string & |
fieldName | ) |
const |
|
overridevirtual |
Get int field value.
- Parameters
-
- Returns
- field value
Implements IRDBRecord.
Definition at line 58 of file RDBRecord.cxx.
66 if(
values[
it->second].specification().type()==
typeid(
int)) {
67 return values[
it->second].data<
int>();
69 else if(
values[
it->second].specification().type()==
typeid(long)) {
70 return (
int)
values[
it->second].data<
long>();
73 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of integer type\n");
◆ getInt() [2/2]
int RDBRecord::getInt |
( |
const std::string & |
fieldName, |
|
|
unsigned int |
index |
|
) |
| const |
|
overridevirtual |
Get array int field value.
- Parameters
-
fieldName | [IN] field name |
index | [IN] index in the array |
- Returns
- field value
Implements IRDBRecord.
Definition at line 147 of file RDBRecord.cxx.
155 if(
values[
it->second].specification().type()==
typeid(
int)) {
156 return values[
it->second].data<
int>();
158 else if(
values[
it->second].specification().type()==
typeid(long)) {
159 return (
int)
values[
it->second].data<
long>();
162 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of integer type\n");
◆ getLong() [1/2]
long RDBRecord::getLong |
( |
const std::string & |
fieldName | ) |
const |
|
overridevirtual |
Get long field value.
- Parameters
-
- Returns
- field value
Implements IRDBRecord.
Definition at line 77 of file RDBRecord.cxx.
85 if(
values[
it->second].specification().type()==
typeid(
long)) {
86 return values[
it->second].data<
long>();
88 else if(
values[
it->second].specification().type()==
typeid(
int)) {
89 return (
long)
values[
it->second].data<
int>();
91 else if(
values[
it->second].specification().type()==
typeid(
long long)) {
92 return (
long)
values[
it->second].data<
long long>();
95 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of long type");
◆ getLong() [2/2]
long RDBRecord::getLong |
( |
const std::string & |
fieldName, |
|
|
unsigned int |
index |
|
) |
| const |
|
overridevirtual |
Get array long field value.
- Parameters
-
fieldName | [IN] field name |
index | [IN] index in the array |
- Returns
- field value
Implements IRDBRecord.
Definition at line 166 of file RDBRecord.cxx.
174 if(
values[
it->second].specification().type()==
typeid(
long)) {
175 return values[
it->second].data<
long>();
177 else if(
values[
it->second].specification().type()==
typeid(
int)) {
178 return (
long)
values[
it->second].data<
int>();
181 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of long type");
◆ getString() [1/2]
const std::string & RDBRecord::getString |
( |
const std::string & |
fieldName | ) |
const |
|
overridevirtual |
Get string field value.
- Parameters
-
- Returns
- field value
Implements IRDBRecord.
Definition at line 131 of file RDBRecord.cxx.
139 if(
values[
it->second].specification().type()==
typeid(std::string)) {
140 return values[
it->second].data<std::string>();
143 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of string type");
◆ getString() [2/2]
const std::string & RDBRecord::getString |
( |
const std::string & |
fieldName, |
|
|
unsigned int |
index |
|
) |
| const |
|
overridevirtual |
Get array string field value.
- Parameters
-
fieldName | [IN] field name |
index | [IN] index in the array |
- Returns
- field value
Implements IRDBRecord.
Definition at line 217 of file RDBRecord.cxx.
225 if(
values[
it->second].specification().type()==
typeid(std::string)) {
226 return values[
it->second].data<std::string>();
229 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of string type");
◆ isFieldNull()
bool RDBRecord::isFieldNull |
( |
const std::string & |
fieldName | ) |
const |
|
overridevirtual |
Check if the field value is NULL.
- Parameters
-
fieldName | [IN] field name @retun TRUE if the field is NULL, FALSE otherwise |
Implements IRDBRecord.
Definition at line 47 of file RDBRecord.cxx.
◆ operator!=()
Definition at line 233 of file RDBRecord.cxx.
238 if(myAttList.size()!=rhsAttList.size())
return true;
240 for(
size_t i(0);
i<myAttList.size(); ++
i) {
241 const coral::Attribute& myAtt = myAttList[
i];
242 const std::string
name = myAtt.specification().name();
244 for(
size_t j(0); j<rhsAttList.size(); ++j) {
245 const coral::Attribute& rhsAtt = rhsAttList[j];
246 if(rhsAtt.specification().name()==
name) {
◆ operator=()
◆ toOutputStream()
std::ostream & RDBRecord::toOutputStream |
( |
std::ostream & |
os | ) |
const |
◆ RDBRecordset
◆ ATLAS_THREAD_SAFE
coral::AttributeList* m_values RDBRecord::ATLAS_THREAD_SAFE |
|
private |
◆ m_name2Index
◆ m_tableName
std::string RDBRecord::m_tableName |
|
private |
The documentation for this class was generated from the following files: