ATLAS Offline Software
IRDBAccessSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
14 #ifndef RDBACCESSSVC_IRDBACCESSSVC_H
15 #define RDBACCESSSVC_IRDBACCESSSVC_H
16 
17 #include "GaudiKernel/IInterface.h"
18 #include <string>
19 #include <memory>
20 
21 #include "CoralBase/AttributeList.h"
22 #include "CoralBase/Attribute.h"
23 
24 class IRDBRecordset;
25 class IRDBQuery;
26 
27 typedef std::shared_ptr<IRDBRecordset> IRDBRecordset_ptr;
28 
30 
31 // Declaration of the interface ID ( interface id, major version, minor version)
32 static const InterfaceID IID_IRDBAccessSvc(1012, 1 , 0);
33 
44 class IRDBAccessSvc : virtual public IInterface
45 {
46  // Special friends who need to call connect()/disconnect() methods
47  friend class GeoModelSvc;
48  friend class SourceCompAlg;
49  friend class TrigRDBManager;
50 
51  public:
52 
54  static const InterfaceID& interfaceID() { return IID_IRDBAccessSvc; }
55 
62  virtual IRDBRecordset_ptr getRecordsetPtr(const std::string& node,
63  const std::string& tag,
64  const std::string& tag2node="",
65  const std::string& connName = "ATLASDD") = 0;
66 
73  virtual std::string getChildTag(const std::string& childNode,
74  const std::string& parentTag,
75  const std::string& parentNode,
76  const std::string& connName = "ATLASDD") = 0;
77 
78 
79  //
80  // ------------------------ WARNING! ----------------------------
81  // --- Following method should be used for special cases only ---
82  // --------------------------------------------------------------
83  //
84  // 1. After calling this function call IRDBQuery::execute() in order
85  // to fetch data from database
86  // 2. Navigate the cursor, get the data and store it into custom
87  // structures.
88  // * The Cursor is NOT BIDIRECTIONAL
89  //
90 
91  virtual std::unique_ptr<IRDBQuery> getQuery(const std::string& node,
92  const std::string& tag,
93  const std::string& tag2node="",
94  const std::string& connName = "ATLASDD") = 0;
95 
100  virtual void getTagDetails(RDBTagDetails& tagDetails,
101  const std::string& tag,
102  const std::string& connName = "ATLASDD") = 0;
103 
104  protected:
109  virtual bool connect(const std::string& connName = "ATLASDD") = 0;
110 
114  virtual bool disconnect(const std::string& connName = "ATLASDD") = 0;
115 
118  virtual bool shutdown(const std::string& connName = "ATLASDD") = 0;
119 
120 };
121 
122 #endif
123 
124 
125 
IRDBAccessSvc::disconnect
virtual bool disconnect(const std::string &connName="ATLASDD")=0
If the counnection counter==1 closes the connection.
IRDBAccessSvc::getQuery
virtual std::unique_ptr< IRDBQuery > getQuery(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
TrigRDBManager
Helper to manage database connections.
Definition: TrigRDBManager.h:21
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
IRDBRecordset
IRDBRecordset is an abstract interface to the RDB Recordsets, which represent a snapshot of HVS-tagge...
Definition: IRDBRecordset.h:35
IRDBAccessSvc::connect
virtual bool connect(const std::string &connName="ATLASDD")=0
Connect to the relational DB.
IRDBAccessSvc::getChildTag
virtual std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName="ATLASDD")=0
Gets the tag name for the node by giving its parent node tag.
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
IRDBQuery
Definition: IRDBQuery.h:13
GeoModelSvc
Definition: GeoModelSvc.h:31
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
RDBTagDetails
coral::AttributeList RDBTagDetails
Definition: IRDBAccessSvc.h:29
IRDBAccessSvc::getTagDetails
virtual void getTagDetails(RDBTagDetails &tagDetails, const std::string &tag, const std::string &connName="ATLASDD")=0
Returns AttributeList with tag details Attributes in the list: Locked (bool), Supported (bool)
IRDBAccessSvc::shutdown
virtual bool shutdown(const std::string &connName="ATLASDD")=0
Closes the connection regardless of the counter value.
IRDBAccessSvc::interfaceID
static const InterfaceID & interfaceID()
Retrieve interface ID.
Definition: IRDBAccessSvc.h:54
SourceCompAlg
Definition: SourceCompAlg.h:17
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
node
Definition: memory_hooks-stdcmalloc.h:74