CMS 3D CMS Logo

DBService.h
Go to the documentation of this file.
1 #ifndef RecoLuminosity_LumiProducer_DBService_h
2 #define RecoLuminosity_LumiProducer_DBService_h
4 
5 #include "RelationalAccess/ISessionProxy.h"
6 #include "RelationalAccess/ConnectionService.h"
7 
8 #include <string>
9 #include <mutex>
10 #include <memory>
11 
12 namespace lumi {
13  class DBConfig;
14  namespace service {
15 
17  public:
18  ISessionProxyPtr(std::unique_ptr<coral::ISessionProxy> iProxy, std::unique_lock<std::mutex> iLock)
19  : m_lock(std::move(iLock)), m_proxy(std::move(iProxy)) {}
20 
21  coral::ISessionProxy* operator->() { return m_proxy.get(); }
22 
23  private:
24  std::unique_lock<std::mutex> m_lock;
25  std::unique_ptr<coral::ISessionProxy> m_proxy;
26  };
27 
28  class DBService {
29  public:
30  DBService(const edm::ParameterSet& iConfig);
31  ~DBService();
32 
33  ISessionProxyPtr connectReadOnly(const std::string& connectstring);
34 
35  private:
36  std::unique_ptr<coral::ConnectionService> m_svc;
37  std::unique_ptr<lumi::DBConfig> m_dbconfig;
39  }; //cl DBService
40  } // namespace service
41 } // namespace lumi
42 #endif
service
Definition: service.py:1
lumi::service::ISessionProxyPtr::operator->
coral::ISessionProxy * operator->()
Definition: DBService.h:21
lumi::service::ISessionProxyPtr
Definition: DBService.h:16
lumi::service::DBService::m_svc
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:36
lumi::service::ISessionProxyPtr::ISessionProxyPtr
ISessionProxyPtr(std::unique_ptr< coral::ISessionProxy > iProxy, std::unique_lock< std::mutex > iLock)
Definition: DBService.h:18
lumi::service::DBService::DBService
DBService(const edm::ParameterSet &iConfig)
Definition: DBService.cc:9
mutex
static boost::mutex mutex
Definition: Proxy.cc:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
lumi::service::DBService::m_dbconfig
std::unique_ptr< lumi::DBConfig > m_dbconfig
Definition: DBService.h:37
lumi::service::ISessionProxyPtr::m_lock
std::unique_lock< std::mutex > m_lock
Definition: DBService.h:24
lumi::service::ISessionProxyPtr::m_proxy
std::unique_ptr< coral::ISessionProxy > m_proxy
Definition: DBService.h:25
lumi::service::DBService::m_mutex
std::mutex m_mutex
Definition: DBService.h:38
lumi::service::DBService
Definition: DBService.h:28
ParameterSet.h
lumi
Definition: LumiSectionData.h:20
lumi::service::DBService::~DBService
~DBService()
Definition: DBService.cc:17
lumi::service::DBService::connectReadOnly
ISessionProxyPtr connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:19