ATLAS Offline Software
SqliteReadSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef RDBACCESSSVC_SQLITEREADSVC_H
13 #define RDBACCESSSVC_SQLITEREADSVC_H
14 
16 #include "SqliteRecordset.h"
17 
19 
20 #include <sqlite3.h>
21 #include <string>
22 #include <map>
23 #include <mutex>
24 
25 class ISvcLocator;
26 
27 template <class TYPE> class SvcFactory;
28 
29 // Map of recordset pointers by table name
30 typedef std::map<std::string, IRDBRecordset_ptr> RecordsetPtrMap;
31 
40 class SqliteReadSvc final : public extends<AthService, IRDBAccessSvc>
41 {
42  public:
44  SqliteReadSvc(const std::string& name, ISvcLocator* svc);
45 
46  StatusCode finalize() override;
47 
52  bool connect(const std::string& connName) override;
53 
56  bool disconnect(const std::string&) override;
57 
60  bool shutdown(const std::string&) override;
61 
65  IRDBRecordset_ptr getRecordsetPtr(const std::string& node
66  , const std::string&
67  , const std::string&
68  , const std::string&) override;
69 
73  std::string getChildTag(const std::string& childNode
74  , const std::string&
75  , const std::string&
76  , const std::string& ) override;
77 
79  std::unique_ptr<IRDBQuery> getQuery(const std::string& node
80  , const std::string&
81  , const std::string&
82  , const std::string& ) override;
83 
85  void getTagDetails(RDBTagDetails& tagDetails
86  , const std::string& tag
87  , const std::string& ) override;
88 
89 private:
91  sqlite3* m_db{nullptr};
94 };
95 
96 #endif
SqliteReadSvc::getChildTag
std::string getChildTag(const std::string &childNode, const std::string &, const std::string &, const std::string &) override
Dummy overrider of the virtual function.
Definition: SqliteReadSvc.cxx:99
SqliteRecordset.h
Declaration of the SqliteRecordset class.
SqliteReadSvc::m_db
sqlite3 * m_db
Definition: SqliteReadSvc.h:91
RecordsetPtrMap
std::map< std::string, IRDBRecordset_ptr > RecordsetPtrMap
Definition: RDBAccessSvc.h:33
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
SvcFactory
Definition: AthCnvSvc.h:28
SqliteReadSvc::getTagDetails
void getTagDetails(RDBTagDetails &tagDetails, const std::string &tag, const std::string &) override
Dummy overrider of the virtual function.
Definition: SqliteReadSvc.cxx:109
SqliteReadSvc::getRecordsetPtr
IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &, const std::string &, const std::string &) override
Provides access to the Recordset object containing HVS-tagged data.
Definition: SqliteReadSvc.cxx:62
SqliteReadSvc::SqliteReadSvc
SqliteReadSvc(const std::string &name, ISvcLocator *svc)
Standard Service Constructor.
Definition: SqliteReadSvc.cxx:19
SqliteReadSvc::disconnect
bool disconnect(const std::string &) override
Dummy overrider of the virtual function.
Definition: SqliteReadSvc.cxx:45
SqliteReadSvc
SqliteReadSvc implementats IRDBAccessSvc interface for reading plain tables in the Geometry SQLite da...
Definition: SqliteReadSvc.h:41
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
RecordsetPtrMap
std::map< std::string, IRDBRecordset_ptr > RecordsetPtrMap
Definition: SqliteReadSvc.h:27
SqliteReadSvc::m_recordsetMutex
std::mutex m_recordsetMutex
Definition: SqliteReadSvc.h:92
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SqliteReadSvc::m_recordsets
RecordsetPtrMap m_recordsets
Definition: SqliteReadSvc.h:90
SqliteReadSvc::connect
bool connect(const std::string &connName) override
Open the SQLite database This method has no effect if the connection has already been opened.
Definition: SqliteReadSvc.cxx:32
RDBTagDetails
coral::AttributeList RDBTagDetails
Definition: IRDBAccessSvc.h:29
AthService.h
SqliteReadSvc::shutdown
bool shutdown(const std::string &) override
Closes the database connection.
Definition: SqliteReadSvc.cxx:51
SqliteReadSvc::getQuery
std::unique_ptr< IRDBQuery > getQuery(const std::string &node, const std::string &, const std::string &, const std::string &) override
Dummy overrider of the virtual function (for now)
Definition: SqliteReadSvc.cxx:88
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
SqliteReadSvc::finalize
StatusCode finalize() override
Definition: SqliteReadSvc.cxx:24
node
Definition: memory_hooks-stdcmalloc.h:74
SqliteReadSvc::m_sessionMutex
std::mutex m_sessionMutex
Definition: SqliteReadSvc.h:93