#include <Container.h>
Public Member Functions | |
const std::string & | className () |
Container (const Container &rhs) | |
Container (Handle< DatabaseContainer > &dbContainer) | |
void | erase (int itemId) |
void | extendSchema (const std::type_info &typeInfo) |
template<typename T > | |
void | extendSchema () |
template<typename T > | |
boost::shared_ptr< T > | fetch (int itemId) |
Object | fetchItem (int itemId) |
void | flush () |
bool | getNames (std::vector< std::string > &destination) |
int | id () |
template<typename T > | |
int | insert (const T &data) |
int | insertItem (const Object &data) |
ContainerIterator | iterator () |
const std::string & | mappingVersion () |
const std::string & | name () |
Container & | operator= (const Container &rhs) |
void | setItemName (const std::string &name, int itemId) |
size_t | size () |
template<typename T > | |
void | update (int itemId, const T &data) |
void | updateItem (int itemId, const Object &data) |
virtual | ~Container () |
Private Member Functions | |
boost::shared_ptr< void > | fetchItemAsType (int itemId, const std::type_info &asTypeInfo) |
int | insertItem (const void *data, const std::type_info &typeInfo) |
void | updateItem (int itemId, const void *data, const std::type_info &typeInfo) |
Private Attributes | |
Handle< DatabaseContainer > | m_dbContainer |
Definition at line 45 of file Container.h.
ora::Container::Container | ( | Handle< DatabaseContainer > & | dbContainer | ) |
Definition at line 43 of file Container.cc.
: m_dbContainer( dbContainer ){ }
ora::Container::Container | ( | const Container & | rhs | ) |
Definition at line 47 of file Container.cc.
: m_dbContainer( rhs.m_dbContainer ){ }
ora::Container::~Container | ( | ) | [virtual] |
Definition at line 51 of file Container.cc.
{ }
const std::string & ora::Container::className | ( | ) |
Definition at line 67 of file Container.cc.
Referenced by cond::MetaData::getToken(), and cond::DbSession::storeObject().
{ return m_dbContainer->className(); }
void ora::Container::erase | ( | int | itemId | ) |
Definition at line 133 of file Container.cc.
Referenced by cond::IOVService::deleteAll(), cond::DbSession::deleteObject(), and ora::Database::erase().
{ m_dbContainer->erase(itemId ); }
void ora::Container::extendSchema | ( | ) | [inline] |
Definition at line 111 of file Container.h.
{ extendSchema( typeid(T) ); }
void ora::Container::extendSchema | ( | const std::type_info & | typeInfo | ) |
Definition at line 84 of file Container.cc.
References ora::ClassUtils::lookupDictionary().
{ Reflex::Type type = ClassUtils::lookupDictionary( typeInfo ); m_dbContainer->extendSchema( type ); }
boost::shared_ptr< T > ora::Container::fetch | ( | int | itemId | ) | [inline] |
Definition at line 117 of file Container.h.
Referenced by ora::Database::fetch(), and cond::DbSession::getTypedObject().
{ return boost::static_pointer_cast<T>( fetchItemAsType( itemId, typeid(T) )); }
ora::Object ora::Container::fetchItem | ( | int | itemId | ) |
Definition at line 89 of file Container.cc.
Referenced by ora::Database::fetchItem(), and cond::DbSession::getObject().
{ return Object( m_dbContainer->fetchItem(itemId), m_dbContainer->type() ); }
boost::shared_ptr< void > ora::Container::fetchItemAsType | ( | int | itemId, |
const std::type_info & | asTypeInfo | ||
) | [private] |
Definition at line 93 of file Container.cc.
References ora::ClassUtils::lookupDictionary().
{ Reflex::Type asType = ClassUtils::lookupDictionary( asTypeInfo ); void* ptr = m_dbContainer->fetchItemAsType(itemId, asType ); if(!ptr) return boost::shared_ptr<void>(); return boost::shared_ptr<void>( ptr, RflxDeleter( m_dbContainer->type() ) ); }
void ora::Container::flush | ( | ) |
Definition at line 137 of file Container.cc.
Referenced by cond::IOVService::deleteAll(), cond::DbSession::deleteObject(), and cond::DbSession::updateObject().
{ m_dbContainer->flush(); }
bool ora::Container::getNames | ( | std::vector< std::string > & | destination | ) |
Definition at line 146 of file Container.cc.
{ return m_dbContainer->getNames( destination ); }
int ora::Container::id | ( | void | ) |
Definition at line 59 of file Container.cc.
Referenced by ora::Database::insert(), ora::Database::insertItem(), and cond::DbSession::storeObject().
{ return m_dbContainer->id(); }
int ora::Container::insert | ( | const T & | data | ) | [inline] |
Definition at line 123 of file Container.h.
Referenced by ora::Database::insert().
{ return insertItem( &data, typeid( data ) ); }
int ora::Container::insertItem | ( | const void * | data, |
const std::type_info & | typeInfo | ||
) | [private] |
Definition at line 110 of file Container.cc.
References ora::ClassUtils::lookupDictionary().
{ Reflex::Type type = ClassUtils::lookupDictionary( typeInfo ); return m_dbContainer->insertItem( data, type ); }
int ora::Container::insertItem | ( | const Object & | data | ) |
Definition at line 101 of file Container.cc.
References ora::Object::address(), ora::throwException(), and ora::Object::type().
Referenced by ora::Database::insertItem().
{ const Reflex::Type& objType = data.type(); if(!objType){ throwException("Object class has not been found in the dictionary.", "Container::insertItem"); } return m_dbContainer->insertItem( data.address(), objType ); }
ora::ContainerIterator ora::Container::iterator | ( | ) |
Definition at line 79 of file Container.cc.
Referenced by cond::IOVService::deleteAll().
{ Handle<IteratorBuffer> buff = m_dbContainer->iteratorBuffer(); return ContainerIterator( buff ); }
const std::string & ora::Container::mappingVersion | ( | ) |
Definition at line 71 of file Container.cc.
{ return m_dbContainer->mappingVersion(); }
const std::string & ora::Container::name | ( | ) |
Definition at line 63 of file Container.cc.
Referenced by cond::MetaData::getToken().
{ return m_dbContainer->name(); }
ora::Container & ora::Container::operator= | ( | const Container & | rhs | ) |
Definition at line 54 of file Container.cc.
References m_dbContainer.
{ if(this != &rhs ) m_dbContainer = rhs.m_dbContainer; return *this; }
void ora::Container::setItemName | ( | const std::string & | name, |
int | itemId | ||
) |
Definition at line 141 of file Container.cc.
Referenced by cond::MetaData::addMapping().
{ m_dbContainer->setItemName( name, itemId ); }
size_t ora::Container::size | ( | void | ) |
Definition at line 75 of file Container.cc.
{ return m_dbContainer->size(); }
void ora::Container::update | ( | int | itemId, |
const T & | data | ||
) | [inline] |
Definition at line 129 of file Container.h.
Referenced by ora::Database::update(), and cond::DbSession::updateObject().
{ return updateItem( itemId, &data, typeid( data ) ); }
void ora::Container::updateItem | ( | int | itemId, |
const void * | data, | ||
const std::type_info & | typeInfo | ||
) | [private] |
Definition at line 126 of file Container.cc.
References ora::ClassUtils::lookupDictionary().
{ Reflex::Type type = ClassUtils::lookupDictionary( typeInfo ); m_dbContainer->updateItem( itemId, data, type ); }
void ora::Container::updateItem | ( | int | itemId, |
const Object & | data | ||
) |
Definition at line 116 of file Container.cc.
References ora::Object::address(), ora::throwException(), and ora::Object::type().
Referenced by ora::Database::updateItem().
{ const Reflex::Type& objType = data.type(); if(!objType){ throwException("Object class has not been found in the dictionary.", "Container::updateItem"); } return m_dbContainer->updateItem( itemId, data.address(), objType ); }
Handle<DatabaseContainer> ora::Container::m_dbContainer [private] |
Definition at line 100 of file Container.h.
Referenced by operator=().