CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
RPCDBCom Class Referenceabstract

#include <RPCDBCom.h>

Inheritance diagram for RPCDBCom:
RPCFw

Public Member Functions

 RPCDBCom ()
 
virtual void run ()=0
 
void setVerbosityLevel (coral::MsgLevel level)
 
virtual ~RPCDBCom ()
 

Protected Member Functions

coral::ISession * connect (const std::string &connectionString, const std::string &userName, const std::string &password)
 

Private Attributes

coral::IConnection * m_connection
 

Detailed Description

Definition at line 12 of file RPCDBCom.h.

Constructor & Destructor Documentation

RPCDBCom::RPCDBCom ( )

Definition at line 8 of file RPCDBCom.cc.

References instance.

8  :
9  m_connection( 0 )
10 {
11  coral::Context& context = coral::Context::instance();
12  context.loadComponent( "CORAL/RelationalPlugins/oracle" );
13  coral::IHandle<coral::IRelationalDomain> domain = context.query<coral::IRelationalDomain>(
14 "CORAL/RelationalPlugins/oracle" );
15  if ( ! domain.isValid() )
16  throw std::runtime_error( "Could not load the OracleAccess plugin" );
17 }
static PFTauRenderPlugin instance
coral::IConnection * m_connection
Definition: RPCDBCom.h:26
RPCDBCom::~RPCDBCom ( )
virtual

Definition at line 20 of file RPCDBCom.cc.

References m_connection.

21 {
22  if ( m_connection ) delete m_connection;
23 }
coral::IConnection * m_connection
Definition: RPCDBCom.h:26

Member Function Documentation

coral::ISession * RPCDBCom::connect ( const std::string &  connectionString,
const std::string &  userName,
const std::string &  password 
)
protected

Definition at line 27 of file RPCDBCom.cc.

References instance, m_connection, and models::session.

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::__init__(), Vispa.Views.PropertyView.BooleanProperty::__init__(), Vispa.Gui.FindDialog.FindDialog::_addScript(), Vispa.Gui.FindDialog.FindDialog::_addStringProperty(), Vispa.Main.Application.Application::_connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::_createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog::addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer::addWidget(), Vispa.Views.PropertyView.PropertyView::append(), Vispa.Views.PropertyView.PropertyView::appendAddRow(), Vispa.Main.Application.Application::createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createButton(), RPCFw::createFEB(), RPCFw::createGAS(), RPCFw::createIDMAP(), RPCFw::createIMON(), Vispa.Views.LineDecayView.LineDecayView::createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createLineEdit(), RPCFw::createMix(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), RPCFw::createSTATUS(), RPCFw::createT(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createTextEdit(), RPCFw::createUXC(), RPCFw::createVMON(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Gui.PortWidget.PortWidget::mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty::setChecked(), Vispa.Main.SplitterTab.SplitterTab::setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab::setController(), Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), Vispa.Views.PropertyView.DropDownProperty::setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty::setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setTab(), Vispa.Views.PropertyView.IntegerProperty::setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController::updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::updateViewMenu().

30 {
31  coral::Context& ctx = coral::Context::instance();
32  ctx.loadComponent("CORAL/RelationalPlugins/oracle");
33  coral::IHandle<coral::IRelationalDomain> iHandle=ctx.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle");
34  if ( ! iHandle.isValid() ) {
35  throw std::runtime_error( "Could not load the OracleAccess plugin" );
36  }
37  std::pair<std::string, std::string> connectionAndSchema = iHandle->decodeUserConnectionString( connectionString );
38 
39  if ( ! m_connection )
40  m_connection = iHandle->newConnection( connectionAndSchema.first );
41 
42  if ( ! m_connection->isConnected() )
43  m_connection->connect();
44 
45  coral::ISession* session = m_connection->newSession( connectionAndSchema.second );
46 
47  if ( session ) {
48  session->startUserSession( userName, password );
49  }
50  //memory leaking
51  return session;
52 }
static PFTauRenderPlugin instance
string connectionString
Definition: autoCondHLT.py:4
coral::IConnection * m_connection
Definition: RPCDBCom.h:26
session
Definition: models.py:201
virtual void RPCDBCom::run ( )
pure virtual

Implemented in RPCFw.

Referenced by Types.EventID::cppID(), and Types.LuminosityBlockID::cppID().

void RPCDBCom::setVerbosityLevel ( coral::MsgLevel  level)

Definition at line 56 of file RPCDBCom.cc.

57 {
58  coral::MessageStream::setMsgVerbosity(level);
59 }
tuple level
Definition: testEve_cfg.py:34

Member Data Documentation

coral::IConnection* RPCDBCom::m_connection
private

Definition at line 26 of file RPCDBCom.h.

Referenced by connect(), and ~RPCDBCom().