ATLAS Offline Software
Loading...
Searching...
No Matches
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) {}
cool::IDatabaseSvc & m_cooldb
coral::IConnectionService & m_coralsvc

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 31 of file CoraCoolDatabaseSvc.cxx.

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

◆ 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 {
25 CoraCoolDatabasePtr dbase(new CoraCoolDatabase(dbconn,
26 std::move(cooldb),
27 m_coralsvc,readonly));
28 return dbase;
29}

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: