ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
SQLiteDBSvc
src
SQLiteDBSvc.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
/*
3
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
#ifndef SQLITEDBSVC_SQLITEDBSVC_H
7
#define SQLITEDBSVC_SQLITEDBSVC_H
8
#include "
AthenaBaseComps/AthService.h
"
9
#include "
SQLiteDBSvc/ISQLiteDBSvc.h
"
10
11
// STL includes
12
#include <memory>
13
14
// Other includes
15
#include "sqlite3.h"
16
21
class
SQLiteDBSvc
:
public
extends<AthService, ISQLiteDBSvc> {
22
public
:
24
SQLiteDBSvc
(
const
std::string& name, ISvcLocator* svcLoc)
25
: extends(name, svcLoc), m_db(nullptr, sqlite3_close_v2) {}
26
27
virtual
StatusCode
initialize
()
override
;
28
35
virtual
SQLite::Statement
createStatement
(
36
std::string_view statement,
37
std::source_location call = std::source_location::current())
override
;
38
39
private
:
40
// Thread-safe because SQLite is used in serialized mode
41
std::unique_ptr<sqlite3, int (*)(sqlite3*)> m_db
ATLAS_THREAD_SAFE
;
42
Gaudi::Property<std::string>
m_databasePath
{
43
this
,
"DatabasePath"
,
":memory:"
,
44
"Path to SQLite Database. The default (:memory:) creates a temporary "
45
"in-memory database. Options may be set using SQLite URI filenames."
};
46
};
47
#endif
// SQLITEDBSVC_SQLITEDBSVC_H
AthService.h
ISQLiteDBSvc.h
SQLiteDBSvc::ATLAS_THREAD_SAFE
std::unique_ptr< sqlite3, int(*)(sqlite3 *)> m_db ATLAS_THREAD_SAFE
Definition
SQLiteDBSvc.h:41
SQLiteDBSvc::createStatement
virtual SQLite::Statement createStatement(std::string_view statement, std::source_location call=std::source_location::current()) override
Compile a prepared statement attached to this database.
Definition
SQLiteDBSvc.cxx:22
SQLiteDBSvc::m_databasePath
Gaudi::Property< std::string > m_databasePath
Definition
SQLiteDBSvc.h:42
SQLiteDBSvc::initialize
virtual StatusCode initialize() override
Initialize.
Definition
SQLiteDBSvc.cxx:7
SQLiteDBSvc::SQLiteDBSvc
SQLiteDBSvc(const std::string &name, ISvcLocator *svcLoc)
Constructor.
Definition
SQLiteDBSvc.h:24
SQLite::Statement
SQLite prepared statement.
Definition
Statement.h:50
Generated on
for ATLAS Offline Software by
1.17.0