ATLAS Offline Software
Loading...
Searching...
No Matches
SqliteReadSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
11
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
25class ISvcLocator;
26
27template <class TYPE> class SvcFactory;
28
29// Map of recordset pointers by table name
30typedef std::map<std::string, IRDBRecordset_ptr> RecordsetPtrMap;
31
39
40class 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
89private:
91 sqlite3* m_db{nullptr};
92 std::mutex m_sessionMutex;
93};
94
95#endif
Definition of the abstract IRDBAccessSvc interface.
coral::AttributeList RDBTagDetails
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
std::map< std::string, IRDBRecordset_ptr > RecordsetPtrMap
std::map< std::string, IRDBRecordset_ptr > RecordsetPtrMap
Declaration of the SqliteRecordset class.
std::string getChildTag(const std::string &childNode, const std::string &, const std::string &, const std::string &) override
Dummy overrider of the virtual function.
RecordsetPtrMap m_recordsets
bool disconnect(const std::string &) override
Dummy overrider of the virtual function.
SqliteReadSvc(const std::string &name, ISvcLocator *svc)
Standard Service Constructor.
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.
StatusCode finalize() override
sqlite3 * m_db
std::mutex m_sessionMutex
void getTagDetails(RDBTagDetails &tagDetails, const std::string &tag, const std::string &) override
Dummy overrider of the virtual function.
bool shutdown(const std::string &) override
Closes the database connection.
bool connect(const std::string &connName) override
Open the SQLite database This method has no effect if the connection has already been opened.
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 node.h:24