LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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 
4 // ======================================================================
5 //
6 // DatabaseConnection
7 //
8 // ======================================================================
9 
11 #include "cetlib/sqlite/ConnectionFactory.h"
12 #include "cetlib/sqlite/detail/DefaultDatabaseOpenPolicy.h"
13 
14 namespace fhicl {
15  class ParameterSet;
16 }
17 
18 namespace art {
20  public:
22 
23  template <typename DatabaseOpenPolicy =
24  cet::sqlite::detail::DefaultDatabaseOpenPolicy,
25  typename... PolicyArgs>
26  cet::sqlite::Connection
27  get(std::string const& filename, PolicyArgs&&... policyArgs)
28  {
29  return factory_.make<DatabaseOpenPolicy>(
30  filename, std::forward<PolicyArgs>(policyArgs)...);
31  }
32 
33  private:
34  cet::sqlite::ConnectionFactory factory_;
35  };
36 }
37 
39 #endif /* art_Framework_Services_System_DatabaseConnection_h */
40 
41 // Local Variables:
42 // mode: c++
43 // End:
#define DECLARE_ART_SERVICE(svc, scope)
Definition: ServiceMacros.h:91
DatabaseConnection(fhicl::ParameterSet const &)
cet::sqlite::ConnectionFactory factory_
parameter set interface
HLT enums.