CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
cond::persistency::PayloadReader Class Reference

#include <PayloadReader.h>

Public Member Functions

void close ()
 
ConnectionPoolconnection ()
 
template<typename T >
std::shared_ptr< Tfetch (const cond::Hash &payloadHash)
 
void open (const std::string &connectionString)
 
void open ()
 
PayloadReaderoperator= (const PayloadReader &rhs)
 
 PayloadReader ()
 
 PayloadReader (const PayloadReader &rhs)
 
virtual ~PayloadReader ()
 

Static Public Attributes

static const char *const PRODUCTION_DB = "oracle://cms_orcon_adg/CMS_CONDITIONS"
 

Private Attributes

std::shared_ptr< ConnectionPoolm_connection
 
Session m_session
 

Detailed Description

Definition at line 23 of file PayloadReader.h.

Constructor & Destructor Documentation

PayloadReader::PayloadReader ( )

Definition at line 7 of file PayloadReader.cc.

References m_connection.

7  {
8  m_connection.reset( new ConnectionPool );
9  }
std::shared_ptr< ConnectionPool > m_connection
Definition: PayloadReader.h:59
PayloadReader::PayloadReader ( const PayloadReader rhs)

Definition at line 11 of file PayloadReader.cc.

11  :
12  m_connection( rhs.m_connection ),
13  m_session( rhs.m_session ){
14  }
std::shared_ptr< ConnectionPool > m_connection
Definition: PayloadReader.h:59
PayloadReader::~PayloadReader ( )
virtual

Definition at line 16 of file PayloadReader.cc.

16  {
17  }

Member Function Documentation

void PayloadReader::close ( void  )
ConnectionPool & PayloadReader::connection ( )

Definition at line 25 of file PayloadReader.cc.

References m_connection.

25  {
26  return *m_connection;
27  }
std::shared_ptr< ConnectionPool > m_connection
Definition: PayloadReader.h:59
template<typename T >
std::shared_ptr< T > PayloadReader::fetch ( const cond::Hash payloadHash)
inline

Definition at line 63 of file PayloadReader.h.

References cond::persistency::Transaction::commit(), cond::persistency::Session::connectionString(), cond::persistency::Session::fetchPayload(), m_session, open(), PRODUCTION_DB, cond::persistency::Transaction::start(), and cond::persistency::Session::transaction().

63  {
64  std::shared_ptr<T> ret;
66  m_session.transaction().start( true );
67  ret = m_session.fetchPayload<T>( payloadHash );
69  return ret;
70  }
void start(bool readOnly=true)
Definition: Session.cc:22
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
Definition: Session.h:218
Transaction & transaction()
Definition: Session.cc:66
std::string connectionString()
Definition: Session.cc:232
static const char *const PRODUCTION_DB
Definition: PayloadReader.h:26
long double T
void PayloadReader::open ( const std::string &  connectionString)

Definition at line 29 of file PayloadReader.cc.

References m_connection, and m_session.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::importConfig().

29  {
30  m_session = m_connection->createSession( connectionString );
31  }
std::shared_ptr< ConnectionPool > m_connection
Definition: PayloadReader.h:59
void PayloadReader::open ( )
PayloadReader & PayloadReader::operator= ( const PayloadReader rhs)

Definition at line 19 of file PayloadReader.cc.

References m_connection, and m_session.

19  {
20  m_connection = rhs.m_connection;
21  m_session = rhs.m_session;
22  return *this;
23  }
std::shared_ptr< ConnectionPool > m_connection
Definition: PayloadReader.h:59

Member Data Documentation

std::shared_ptr<ConnectionPool> cond::persistency::PayloadReader::m_connection
private

Definition at line 59 of file PayloadReader.h.

Referenced by connection(), open(), operator=(), and PayloadReader().

Session cond::persistency::PayloadReader::m_session
private

Definition at line 60 of file PayloadReader.h.

Referenced by close(), fetch(), open(), and operator=().

const char* const cond::persistency::PayloadReader::PRODUCTION_DB = "oracle://cms_orcon_adg/CMS_CONDITIONS"
static

Definition at line 26 of file PayloadReader.h.

Referenced by fetch(), and open().