ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CoraCoolDatabaseSvc Class Reference

#include <CoraCoolDatabaseSvc.h>

Collaboration diagram for CoraCoolDatabaseSvc:

Public Member Functions

 CoraCoolDatabaseSvc (coral::IConnectionService &coralsvc, cool::IDatabaseSvc &cooldb)
 
cool::IDatabaseSvc & coolIDatabaseSvc ()
 
CoraCoolDatabasePtr openDatabase (const std::string &dbconn, cool::IDatabasePtr cooldb, bool readonly=false)
 
CoraCoolDatabasePtr openDatabase (const std::string &dbconn, bool readonly=false)
 

Private Attributes

coral::IConnectionService & m_coralsvc
 
cool::IDatabaseSvc & m_cooldb
 

Detailed Description

Definition at line 25 of file CoraCoolDatabaseSvc.h.

Constructor & Destructor Documentation

◆ CoraCoolDatabaseSvc()

CoraCoolDatabaseSvc::CoraCoolDatabaseSvc ( coral::IConnectionService &  coralsvc,
cool::IDatabaseSvc &  cooldb 
)

Definition at line 15 of file CoraCoolDatabaseSvc.cxx.

17  :
18  m_coralsvc(coralsvc), m_cooldb(cooldb) {}

Member Function Documentation

◆ coolIDatabaseSvc()

cool::IDatabaseSvc & CoraCoolDatabaseSvc::coolIDatabaseSvc ( )

Definition at line 20 of file CoraCoolDatabaseSvc.cxx.

20  {
21  return m_cooldb; }

◆ openDatabase() [1/2]

CoraCoolDatabasePtr CoraCoolDatabaseSvc::openDatabase ( const std::string &  dbconn,
bool  readonly = false 
)

Definition at line 30 of file CoraCoolDatabaseSvc.cxx.

31  {
32  cool::IDatabasePtr cooldb;
33  try {
34  cooldb=m_cooldb.openDatabase(dbconn,readonly);
35  }
36  catch (cool::Exception& e) {
37  // try to create database - assuming it did not exist before
38  try {
39  if (readonly) throw std::exception();
40  cooldb=m_cooldb.createDatabase(dbconn);
41  }
42  catch (std::exception& e) {
43  throw CoraCoolException("Cannot connect to or create COOL database",
44  "CoraCoolDatabaseSvc::openDatabase");
45  }
46  }
47  CoraCoolDatabasePtr dbase(new CoraCoolDatabase(dbconn,cooldb,m_coralsvc,readonly));
48  return dbase;
49 }

◆ openDatabase() [2/2]

CoraCoolDatabasePtr CoraCoolDatabaseSvc::openDatabase ( const std::string &  dbconn,
cool::IDatabasePtr  cooldb,
bool  readonly = false 
)

Definition at line 23 of file CoraCoolDatabaseSvc.cxx.

24  {
26  cooldb,m_coralsvc,readonly));
27  return dbase;
28 }

Member Data Documentation

◆ m_cooldb

cool::IDatabaseSvc& CoraCoolDatabaseSvc::m_cooldb
private

Definition at line 42 of file CoraCoolDatabaseSvc.h.

◆ m_coralsvc

coral::IConnectionService& CoraCoolDatabaseSvc::m_coralsvc
private

Definition at line 41 of file CoraCoolDatabaseSvc.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CoraCoolDatabaseSvc::m_coralsvc
coral::IConnectionService & m_coralsvc
Definition: CoraCoolDatabaseSvc.h:41
CoraCoolDatabase
Definition: CoraCoolDatabase.h:24
calibdata.exception
exception
Definition: calibdata.py:496
CoraCoolDatabasePtr
boost::shared_ptr< CoraCoolDatabase > CoraCoolDatabasePtr
Definition: CoraCoolTypes.h:12
dumpBeamSpot.dbconn
dbconn
Definition: dumpBeamSpot.py:27
CoraCoolDatabaseSvc::m_cooldb
cool::IDatabaseSvc & m_cooldb
Definition: CoraCoolDatabaseSvc.h:42
CoraCoolException
Definition: CoraCoolException.h:13