Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
Services
System
DatabaseConnection.h
Go to the documentation of this file.
1
#ifndef art_Framework_Services_System_DatabaseConnection_h
2
#define art_Framework_Services_System_DatabaseConnection_h
3
// vim: set sw=2 expandtab :
4
5
#include "
art/Framework/Services/Registry/ServiceDeclarationMacros.h
"
6
#include "
cetlib/sqlite/ConnectionFactory.h
"
7
#include "
cetlib/sqlite/detail/DefaultDatabaseOpenPolicy.h
"
8
9
#include <string>
10
#include <utility>
11
12
namespace
fhicl
{
13
class
ParameterSet;
14
}
// namespace fhicl
15
16
namespace
art
{
17
18
class
DatabaseConnection
{
19
public
:
20
explicit
DatabaseConnection
(
fhicl::ParameterSet
const
&) {}
21
template
<
typename
DatabaseOpenPolicy =
22
cet::sqlite::detail::DefaultDatabaseOpenPolicy
,
23
typename
... PolicyArgs>
24
cet::sqlite::Connection
*
25
get
(
std::string
const
&
filename
, PolicyArgs&&... policyArgs)
26
{
27
return
factory_.make_connection<DatabaseOpenPolicy>(
28
filename
, std::forward<PolicyArgs>(policyArgs)...);
29
}
30
31
private
:
32
cet::sqlite::ConnectionFactory
factory_
;
33
};
34
35
}
// namespace art
36
37
DECLARE_ART_SERVICE
(
art::DatabaseConnection
, SHARED)
38
#endif
/* art_Framework_Services_System_DatabaseConnection_h */
39
40
// Local Variables:
41
// mode: c++
42
// End:
string
std::string string
Definition:
nybbler.cc:12
cet::sqlite::ConnectionFactory
Definition:
ConnectionFactory.h:43
art::DatabaseConnection::DatabaseConnection
DatabaseConnection(fhicl::ParameterSet const &)
Definition:
DatabaseConnection.h:20
art::DatabaseConnection::factory_
cet::sqlite::ConnectionFactory factory_
Definition:
DatabaseConnection.h:32
train.filename
string filename
Definition:
train.py:213
ServiceDeclarationMacros.h
DefaultDatabaseOpenPolicy.h
DECLARE_ART_SERVICE
#define DECLARE_ART_SERVICE(svc, scope)
Definition:
ServiceDeclarationMacros.h:77
fhicl
Definition:
InputSourceFactory.h:7
ConnectionFactory.h
cet::sqlite::detail::DefaultDatabaseOpenPolicy
Definition:
DefaultDatabaseOpenPolicy.h:17
cet::sqlite::Connection
Definition:
Connection.h:31
art::DatabaseConnection
Definition:
DatabaseConnection.h:18
art
Definition:
BasicOptionsHandler.h:9
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11