SqliteReadSvc implementats IRDBAccessSvc interface for reading plain tables in the Geometry SQLite database.
More...
#include <SqliteReadSvc.h>
|
| | SqliteReadSvc (const std::string &name, ISvcLocator *svc) |
| | Standard Service Constructor.
|
| StatusCode | finalize () override |
| bool | connect (std::string_view connName) override |
| | Open the SQLite database This method has no effect if the connection has already been opened.
|
| bool | disconnect (std::string_view connName) override |
| | Dummy overrider of the virtual function.
|
| bool | shutdown (std::string_view connName) override |
| | Closes the database connection.
|
| IRDBRecordset_ptr | getRecordsetPtr (std::string_view node, std::string_view tag, std::string_view tag2node, std::string_view connName) override |
| | Provides access to the Recordset object containing HVS-tagged data.
|
| std::string | getChildTag (const std::string &childNode, const std::string &, const std::string &, const std::string &) override |
| | Dummy overrider of the virtual function.
|
| 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).
|
| void | getTagDetails (RDBTagDetails &tagDetails, const std::string &tag, const std::string &) override |
| | Dummy overrider of the virtual function.
|
SqliteReadSvc implementats IRDBAccessSvc interface for reading plain tables in the Geometry SQLite database.
Definition at line 40 of file SqliteReadSvc.h.
◆ SqliteReadSvc()
| SqliteReadSvc::SqliteReadSvc |
( |
const std::string & | name, |
|
|
ISvcLocator * | svc ) |
Standard Service Constructor.
Definition at line 19 of file SqliteReadSvc.cxx.
20 : base_class(name,svc)
21{
22}
◆ connect()
| bool SqliteReadSvc::connect |
( |
std::string_view | connName | ) |
|
|
override |
Open the SQLite database This method has no effect if the connection has already been opened.
- Parameters
-
| connName | [IN] path to the SQLite database file |
- Returns
- success/failure
Definition at line 32 of file SqliteReadSvc.cxx.
33{
35 const std::string connNameStr{connName};
37 int res = sqlite3_open(connNameStr.c_str(), &
m_db);
38 if (
res != SQLITE_OK) {
40 return false;
41 }
42 }
43 return true;
44}
std::pair< std::vector< unsigned int >, bool > res
std::mutex m_sessionMutex
◆ disconnect()
| bool SqliteReadSvc::disconnect |
( |
std::string_view | connName | ) |
|
|
override |
Dummy overrider of the virtual function.
- Returns
- success/failure
Definition at line 46 of file SqliteReadSvc.cxx.
47{
48
49 return true;
50}
◆ finalize()
| StatusCode SqliteReadSvc::finalize |
( |
| ) |
|
|
override |
Definition at line 24 of file SqliteReadSvc.cxx.
25{
28
29 return StatusCode::SUCCESS;
30}
RecordsetPtrMap m_recordsets
bool shutdown(std::string_view connName) override
Closes the database connection.
◆ getChildTag()
| std::string SqliteReadSvc::getChildTag |
( |
const std::string & | childNode, |
|
|
const std::string & | parentTag, |
|
|
const std::string & | parentNode, |
|
|
const std::string & | ) |
|
override |
Dummy overrider of the virtual function.
- Parameters
-
| childNode | [IN] the name of the table |
- Returns
- the name of the table if exists, otherwise an empty string
Definition at line 100 of file SqliteReadSvc.cxx.
104{
105 ATH_MSG_DEBUG(
"getChildTag for " << childNode <<
" " << parentTag <<
" " << parentNode);
107 return std::string();
108}
#define ATH_MSG_WARNING(x)
◆ getQuery()
| std::unique_ptr< IRDBQuery > SqliteReadSvc::getQuery |
( |
const std::string & | node, |
|
|
const std::string & | tag, |
|
|
const std::string & | tag2node, |
|
|
const std::string & | connName ) |
|
override |
Dummy overrider of the virtual function (for now).
Definition at line 89 of file SqliteReadSvc.cxx.
93{
94 ATH_MSG_DEBUG(
"getQuery (" << node <<
"," << tag <<
"," << tag2node <<
"," << connName <<
")");
96
97 return std::unique_ptr<IRDBQuery>();
98}
◆ getRecordsetPtr()
| IRDBRecordset_ptr SqliteReadSvc::getRecordsetPtr |
( |
std::string_view | node, |
|
|
std::string_view | tag, |
|
|
std::string_view | tag2node, |
|
|
std::string_view | connName ) |
|
override |
Provides access to the Recordset object containing HVS-tagged data.
- Parameters
-
| node | [IN] name of the table. Other input parameters are dummy |
- Returns
- pointer to the recordset object
Definition at line 63 of file SqliteReadSvc.cxx.
67{
69
72 ATH_MSG_ERROR(
"Connection to the SQLite database not open. Returning empty recordset");
74 }
75
79 return itRecordset->second;
80 }
81 const std::string nodeStr{node};
82 SqliteRecordset* recConcrete = new SqliteRecordset();
86 return rec;
87}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
void getData(sqlite3 *db, const std::string &nodeName)
Constructs SQL query and retrieves data from the DB.
◆ getTagDetails()
◆ shutdown()
| bool SqliteReadSvc::shutdown |
( |
std::string_view | connName | ) |
|
|
override |
Closes the database connection.
- Returns
- success/failure
Definition at line 52 of file SqliteReadSvc.cxx.
53{
58 }
59 return true;
60}
◆ m_db
| sqlite3* SqliteReadSvc::m_db {nullptr} |
|
private |
◆ m_recordsets
◆ m_sessionMutex
| std::mutex SqliteReadSvc::m_sessionMutex |
|
private |
The documentation for this class was generated from the following files: