ATLAS Offline Software
IRDBQuery.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RDBACCESSSVC_IRDBQUERY_H
6 #define RDBACCESSSVC_IRDBQUERY_H
7 
8 #include "CoralBase/AttributeList.h"
9 #include "CoralBase/Attribute.h"
10 #include <string>
11 
12 class IRDBQuery
13 {
14  public:
15  IRDBQuery() = default;
16  virtual ~IRDBQuery() = default;
17 
18  virtual void execute() = 0;
19  virtual long size() = 0;
20  virtual void finalize() = 0;
21  virtual void setOrder(const std::string&) = 0;
22  virtual void addToOutput(const std::string&) = 0;
23 
24  virtual bool next() = 0;
25 
26  template<typename T> const T& data(const std::string&);
27  template<typename T> const T& data(unsigned int);
28  bool isNull(const std::string&);
29  bool isNull(unsigned int);
30 
31  protected:
33 };
34 
35 template<typename T> const T& IRDBQuery::data(const std::string& field)
36 {
37  return (*m_attrList)[field].data<T>();
38 }
39 
40 template<typename T> const T& IRDBQuery::data(unsigned int fieldInd)
41 {
42  return (*m_attrList)[fieldInd].data<T>();
43 }
44 
45 inline bool IRDBQuery::isNull(const std::string& field)
46 {
47  return (*m_attrList)[field].isNull();
48 }
49 
50 inline bool IRDBQuery::isNull(unsigned int fieldInd)
51 {
52  return (*m_attrList)[fieldInd].isNull();
53 }
54 
55 #endif
IRDBQuery::isNull
bool isNull(const std::string &)
Definition: IRDBQuery.h:45
IRDBQuery::setOrder
virtual void setOrder(const std::string &)=0
IRDBQuery::m_attrList
const coral::AttributeList * m_attrList
Definition: IRDBQuery.h:32
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
IRDBQuery::addToOutput
virtual void addToOutput(const std::string &)=0
IRDBQuery
Definition: IRDBQuery.h:13
IRDBQuery::~IRDBQuery
virtual ~IRDBQuery()=default
IRDBQuery::finalize
virtual void finalize()=0
IRDBQuery::data
const T & data(const std::string &)
Definition: IRDBQuery.h:35
IRDBQuery::IRDBQuery
IRDBQuery()=default
IRDBQuery::next
virtual bool next()=0
IRDBQuery::size
virtual long size()=0
IRDBQuery::execute
virtual void execute()=0
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35