CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ora::Database Class Reference

#include <Database.h>

Public Member Functions

Configurationconfiguration ()
 
bool connect (const std::string &connectionString, bool readOnly=false)
 
bool connect (const std::string &connectionString, const std::string &asRole, bool readOnly=false)
 
bool connect (boost::shared_ptr< coral::ISessionProxy > &coralSession, const std::string &connectionString, const std::string &schemaName="")
 
const std::string & connectionString ()
 
Container containerHandle (const std::string &name)
 
Container containerHandle (int contId)
 
std::set< std::string > containers ()
 
bool create (std::string userSchemaVersion=std::string(""))
 
template<typename T >
Container createContainer (const std::string &name)
 
template<typename T >
Container createContainer ()
 
Container createContainer (const std::string &className, std::string name="")
 
template<typename T >
ora::Container createContainer (const std::string &name)
 
template<typename T >
ora::Container createContainer ()
 
 Database ()
 
 Database (const Database &rhs)
 
 Database (boost::shared_ptr< ConnectionPool > &connectionPool)
 
void disconnect ()
 
bool drop ()
 
bool dropContainer (const std::string &name)
 
void erase (const OId &oid)
 
bool eraseAllNames ()
 
bool eraseObjectName (const std::string &name)
 
bool exists ()
 
template<typename T >
boost::shared_ptr< Tfetch (const OId &oid)
 
template<typename T >
boost::shared_ptr< TfetchByName (const std::string &name)
 
Object fetchItem (const OId &oid)
 
Object fetchItemByName (const std::string &name)
 
void flush ()
 
bool getItemId (const std::string &name, OId &destination)
 
bool getNamesForObject (const OId &oid, std::vector< std::string > &destination)
 
template<typename T >
OId insert (const std::string &containerName, const T &data)
 
template<typename T >
OId insert (const T &data)
 
template<typename T >
ora::OId insert (const std::string &containerName, const T &data)
 
template<typename T >
ora::OId insert (const T &data)
 
OId insertItem (const std::string &containerName, const Object &data)
 
bool isConnected ()
 
bool listObjectNames (std::vector< std::string > &destination)
 
bool lockContainer (const std::string &name)
 
Databaseoperator= (const Database &rhs)
 
ora::Version schemaVersion (bool userSchema=false)
 
void setAccessPermission (const std::string &principal, bool forWrite)
 
void setObjectName (const std::string &name, const OId &oid)
 
SharedSessionstorageAccessSession ()
 
Transactiontransaction ()
 
template<typename T >
void update (const OId &oid, const T &data)
 
void updateItem (const OId &oid, const Object &data)
 
DatabaseUtility utility ()
 
virtual ~Database ()
 

Static Public Member Functions

static std::string nameForContainer (const std::type_info &typeInfo)
 
static std::string nameForContainer (const std::string &className)
 

Private Member Functions

void checkTransaction ()
 
Container createContainer (const std::string &name, const std::type_info &typeInfo)
 
Container createContainer (const std::type_info &typeInfo)
 
Container getContainer (const std::string &name, const std::type_info &typeInfo)
 
Container getContainer (const std::type_info &typeInfo)
 
boost::shared_ptr< void > getTypedObjectByName (const std::string &name, const std::type_info &typeInfo)
 
void open (bool writingAccess=false)
 

Private Attributes

boost::shared_ptr< DatabaseImplm_impl
 

Detailed Description

Definition at line 28 of file Database.h.

Constructor & Destructor Documentation

ora::Database::Database ( )
ora::Database::Database ( const Database rhs)
ora::Database::Database ( boost::shared_ptr< ConnectionPool > &  connectionPool)
ora::Database::~Database ( )
virtual

Definition at line 78 of file Database.cc.

Member Function Documentation

void ora::Database::checkTransaction ( )
private

Definition at line 124 of file Database.cc.

ora::Configuration & ora::Database::configuration ( )

Definition at line 86 of file Database.cc.

bool ora::Database::connect ( const std::string &  connectionString,
bool  readOnly = false 
)
bool ora::Database::connect ( const std::string &  connectionString,
const std::string &  asRole,
bool  readOnly = false 
)
bool ora::Database::connect ( boost::shared_ptr< coral::ISessionProxy > &  coralSession,
const std::string &  connectionString,
const std::string &  schemaName = "" 
)
const std::string & ora::Database::connectionString ( )

Definition at line 113 of file Database.cc.

ora::Container ora::Database::containerHandle ( const std::string &  name)

Definition at line 275 of file Database.cc.

ora::Container ora::Database::containerHandle ( int  contId)

Definition at line 285 of file Database.cc.

std::set< std::string > ora::Database::containers ( )

Definition at line 194 of file Database.cc.

bool ora::Database::create ( std::string  userSchemaVersion = std::string(""))

Definition at line 138 of file Database.cc.

template<typename T >
Container ora::Database::createContainer ( const std::string &  name)
template<typename T >
Container ora::Database::createContainer ( )

Referenced by createContainer().

ora::Container ora::Database::createContainer ( const std::string &  className,
std::string  name = "" 
)

Definition at line 229 of file Database.cc.

ora::Container ora::Database::createContainer ( const std::string &  name,
const std::type_info &  typeInfo 
)
private

Definition at line 205 of file Database.cc.

ora::Container ora::Database::createContainer ( const std::type_info &  typeInfo)
private

Definition at line 217 of file Database.cc.

template<typename T >
ora::Container ora::Database::createContainer ( const std::string &  name)
inline

Definition at line 208 of file Database.h.

References createContainer().

208  {
209  return createContainer( name, typeid(T) );
210 }
Container createContainer()
long double T
template<typename T >
ora::Container ora::Database::createContainer ( )
inline

Definition at line 214 of file Database.h.

214  {
215  return createContainer( typeid(T) );
216 }
Container createContainer()
long double T
void ora::Database::disconnect ( void  )
bool ora::Database::drop ( )

Definition at line 147 of file Database.cc.

bool ora::Database::dropContainer ( const std::string &  name)

Definition at line 256 of file Database.cc.

void ora::Database::erase ( const OId oid)

Definition at line 317 of file Database.cc.

bool ora::Database::eraseAllNames ( )

Definition at line 342 of file Database.cc.

bool ora::Database::eraseObjectName ( const std::string &  name)

Definition at line 337 of file Database.cc.

bool ora::Database::exists ( )

Definition at line 133 of file Database.cc.

template<typename T >
boost::shared_ptr< T > ora::Database::fetch ( const OId oid)
inline

Definition at line 220 of file Database.h.

References generateEDF::cont, ora::OId::containerId(), ora::Container::fetch(), and ora::OId::itemId().

220  {
221  Container cont = containerHandle( oid.containerId() );
222  return cont.fetch<T>( oid.itemId() );
223 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
Container containerHandle(const std::string &name)
Definition: Database.cc:275
boost::shared_ptr< T > fetch(int itemId)
Definition: Container.h:129
long double T
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
template<typename T >
boost::shared_ptr< T > ora::Database::fetchByName ( const std::string &  name)
inline

Definition at line 252 of file Database.h.

252  {
253  return boost::static_pointer_cast<T>( getTypedObjectByName( name, typeid(T) ) );
254 }
boost::shared_ptr< void > getTypedObjectByName(const std::string &name, const std::type_info &typeInfo)
Definition: Database.cc:352
long double T
ora::Object ora::Database::fetchItem ( const OId oid)

Definition at line 297 of file Database.cc.

ora::Object ora::Database::fetchItemByName ( const std::string &  name)

Definition at line 358 of file Database.cc.

void ora::Database::flush ( )

Definition at line 323 of file Database.cc.

ora::Container ora::Database::getContainer ( const std::string &  name,
const std::type_info &  typeInfo 
)
private

Definition at line 242 of file Database.cc.

ora::Container ora::Database::getContainer ( const std::type_info &  typeInfo)
private

Definition at line 249 of file Database.cc.

bool ora::Database::getItemId ( const std::string &  name,
ora::OId destination 
)

Definition at line 347 of file Database.cc.

bool ora::Database::getNamesForObject ( const OId oid,
std::vector< std::string > &  destination 
)

Definition at line 363 of file Database.cc.

boost::shared_ptr< void > ora::Database::getTypedObjectByName ( const std::string &  name,
const std::type_info &  typeInfo 
)
private

Definition at line 352 of file Database.cc.

template<typename T >
OId ora::Database::insert ( const std::string &  containerName,
const T data 
)
template<typename T >
OId ora::Database::insert ( const T data)
template<typename T >
ora::OId ora::Database::insert ( const std::string &  containerName,
const T data 
)
inline

Definition at line 227 of file Database.h.

References generateEDF::cont, ora::Container::id(), and ora::Container::insert().

228  {
229  Container cont = getContainer( containerName, typeid(data) );
230  int itemId = cont.insert( data );
231  return OId( cont.id(), itemId );
232 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Container getContainer(const std::string &name, const std::type_info &typeInfo)
Definition: Database.cc:242
template<typename T >
ora::OId ora::Database::insert ( const T data)
inline

Definition at line 236 of file Database.h.

References generateEDF::cont, ora::Container::id(), and ora::Container::insert().

236  {
237  Container cont = getContainer( typeid(data) );
238  int itemId = cont.insert( data );
239  return OId( cont.id(), itemId );
240 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Container getContainer(const std::string &name, const std::type_info &typeInfo)
Definition: Database.cc:242
ora::OId ora::Database::insertItem ( const std::string &  containerName,
const Object data 
)

Definition at line 302 of file Database.cc.

bool ora::Database::isConnected ( )

Definition at line 109 of file Database.cc.

bool ora::Database::listObjectNames ( std::vector< std::string > &  destination)

Definition at line 372 of file Database.cc.

bool ora::Database::lockContainer ( const std::string &  name)

Definition at line 265 of file Database.cc.

std::string ora::Database::nameForContainer ( const std::type_info &  typeInfo)
static

Definition at line 57 of file Database.cc.

std::string ora::Database::nameForContainer ( const std::string &  className)
static

Definition at line 62 of file Database.cc.

void ora::Database::open ( bool  writingAccess = false)
private

Definition at line 174 of file Database.cc.

ora::Database & ora::Database::operator= ( const Database rhs)

Definition at line 81 of file Database.cc.

ora::Version ora::Database::schemaVersion ( bool  userSchema = false)

Definition at line 186 of file Database.cc.

void ora::Database::setAccessPermission ( const std::string &  principal,
bool  forWrite 
)

Definition at line 162 of file Database.cc.

void ora::Database::setObjectName ( const std::string &  name,
const OId oid 
)

Definition at line 332 of file Database.cc.

ora::SharedSession & ora::Database::storageAccessSession ( )

Definition at line 386 of file Database.cc.

ora::Transaction & ora::Database::transaction ( )

Definition at line 117 of file Database.cc.

template<typename T >
void ora::Database::update ( const OId oid,
const T data 
)
inline

Definition at line 244 of file Database.h.

References generateEDF::cont, ora::OId::containerId(), data, ora::OId::itemId(), and ora::Container::update().

Referenced by Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom().

245  {
246  Container cont = containerHandle( oid.containerId() );
247  cont.update( oid.itemId(), data );
248 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
Container containerHandle(const std::string &name)
Definition: Database.cc:275
void update(int itemId, const T &data)
Definition: Container.h:141
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
void ora::Database::updateItem ( const OId oid,
const Object data 
)

Definition at line 310 of file Database.cc.

ora::DatabaseUtility ora::Database::utility ( )

Definition at line 380 of file Database.cc.

Member Data Documentation

boost::shared_ptr<DatabaseImpl> ora::Database::m_impl
private

Definition at line 200 of file Database.h.