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
static boost::mutex mutex
Definition: Proxy.cc:9
std::unique_ptr< lumi::DBConfig > m_dbconfig
Definition: DBService.h:37
ISessionProxyPtr(std::unique_ptr< coral::ISessionProxy > iProxy, std::unique_lock< std::mutex > iLock)
Definition: DBService.h:18
std::unique_ptr< coral::ISessionProxy > m_proxy
Definition: DBService.h:25
coral::ISessionProxy * operator->()
Definition: DBService.h:21
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:36
std::unique_lock< std::mutex > m_lock
Definition: DBService.h:24
def move(src, dest)
Definition: eostools.py:511