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,
19  std::unique_lock<std::mutex> iLock):
20  m_lock(std::move(iLock)),
21  m_proxy(std::move(iProxy)) {}
22 
23  coral::ISessionProxy* operator->() {
24  return m_proxy.get();
25  }
26  private:
27  std::unique_lock<std::mutex> m_lock;
28  std::unique_ptr<coral::ISessionProxy> m_proxy;
29  };
30 
31  class DBService{
32  public:
33  DBService(const edm::ParameterSet& iConfig);
34  ~DBService();
35 
36  ISessionProxyPtr connectReadOnly( const std::string& connectstring );
37 
38  private:
39  std::unique_ptr<coral::ConnectionService> m_svc;
40  std::unique_ptr<lumi::DBConfig> m_dbconfig;
42  };//cl DBService
43  }//ns service
44 }//ns lumi
45 #endif
static boost::mutex mutex
Definition: Proxy.cc:11
std::unique_ptr< lumi::DBConfig > m_dbconfig
Definition: DBService.h:40
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:28
coral::ISessionProxy * operator->()
Definition: DBService.h:23
std::unique_ptr< coral::ConnectionService > m_svc
Definition: DBService.h:39
std::unique_lock< std::mutex > m_lock
Definition: DBService.h:27
def move(src, dest)
Definition: eostools.py:510