CMS 3D CMS Logo

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

#include <Container.h>

Public Member Functions

const std::string & className ()
 
 Container ()
 
 Container (Handle< DatabaseContainer > &dbContainer)
 
 Container (const Container &rhs)
 
void erase (int itemId)
 
void extendSchema (const std::type_info &typeInfo)
 
template<typename T >
void extendSchema ()
 
template<typename T >
boost::shared_ptr< Tfetch (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)
 
bool isLocked ()
 
ContainerIterator iterator ()
 
bool lock ()
 
const std::string & mappingVersion ()
 
const std::string & name ()
 
Containeroperator= (const Container &rhs)
 
std::string realClassName ()
 
void setAccessPermission (const std::string &principal, bool forWrite)
 
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< DatabaseContainerm_dbContainer
 

Detailed Description

Definition at line 45 of file Container.h.

Constructor & Destructor Documentation

ora::Container::Container ( )

Definition at line 47 of file Container.cc.

47  :
48  m_dbContainer(){
49 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
ora::Container::Container ( Handle< DatabaseContainer > &  dbContainer)
explicit

Definition at line 51 of file Container.cc.

51  :
52  m_dbContainer( dbContainer ){
53 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
ora::Container::Container ( const Container rhs)

Definition at line 55 of file Container.cc.

55  :
56  m_dbContainer( rhs.m_dbContainer ){
57 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
ora::Container::~Container ( )
virtual

Definition at line 59 of file Container.cc.

59  {
60 }

Member Function Documentation

const std::string & ora::Container::className ( )

Definition at line 75 of file Container.cc.

Referenced by cond::PoolTokenParser::className(), cond::IOVImportIterator::importMoreElements(), and cond::PoolTokenWriter::write().

75  {
76  return m_dbContainer->className();
77 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
void ora::Container::erase ( int  itemId)

Definition at line 161 of file Container.cc.

Referenced by ora::Database::erase().

161  {
162  m_dbContainer->erase(itemId );
163 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
void ora::Container::extendSchema ( const std::type_info &  typeInfo)

Definition at line 99 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

99  {
101  m_dbContainer->extendSchema( type );
102 }
type
Definition: HCALResponse.h:21
edm::TypeWithDict lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:170
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
template<typename T >
void ora::Container::extendSchema ( )
inline

Definition at line 123 of file Container.h.

123  {
124  extendSchema( typeid(T) );
125 }
void extendSchema()
Definition: Container.h:123
long double T
template<typename T >
boost::shared_ptr< T > ora::Container::fetch ( int  itemId)
inline

Definition at line 129 of file Container.h.

Referenced by ora::Database::fetch().

129  {
130  return boost::static_pointer_cast<T>( fetchItemAsType( itemId, typeid(T) ));
131 }
boost::shared_ptr< void > fetchItemAsType(int itemId, const std::type_info &asTypeInfo)
Definition: Container.cc:113
long double T
ora::Object ora::Container::fetchItem ( int  itemId)

Definition at line 109 of file Container.cc.

Referenced by ora::Database::fetchItem().

109  {
110  return Object( m_dbContainer->fetchItem(itemId), m_dbContainer->type() );
111 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
boost::shared_ptr< void > ora::Container::fetchItemAsType ( int  itemId,
const std::type_info &  asTypeInfo 
)
private

Definition at line 113 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

114  {
115  edm::TypeWithDict asType = ClassUtils::lookupDictionary( asTypeInfo );
116  void* ptr = m_dbContainer->fetchItemAsType(itemId, asType );
117  if(!ptr) return boost::shared_ptr<void>();
118  return boost::shared_ptr<void>( ptr, RflxDeleter( m_dbContainer->type() ) );
119 }
edm::TypeWithDict lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:170
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
void ora::Container::flush ( )

Definition at line 165 of file Container.cc.

165  {
166  m_dbContainer->flush();
167 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
bool ora::Container::getNames ( std::vector< std::string > &  destination)

Definition at line 174 of file Container.cc.

174  {
175  return m_dbContainer->getNames( destination );
176 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
int ora::Container::id ( )

Definition at line 67 of file Container.cc.

Referenced by ora::Database::insert(), ora::Database::insertItem(), and cond::PoolTokenParser::parse().

67  {
68  return m_dbContainer->id();
69 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
template<typename T >
int ora::Container::insert ( const T data)
inline

Definition at line 135 of file Container.h.

Referenced by BeautifulSoup.PageElement::_invert(), and ora::Database::insert().

135  {
136  return insertItem( &data, typeid( data ) );
137 }
int insertItem(const Object &data)
Definition: Container.cc:129
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int ora::Container::insertItem ( const Object data)

Definition at line 129 of file Container.cc.

References ora::Object::address(), ora::throwException(), and ora::Object::type().

Referenced by ora::Database::insertItem().

129  {
130  const edm::TypeWithDict& objType = data.type();
131  if(!objType){
132  throwException("Object class has not been found in the dictionary.",
133  "Container::insertItem");
134  }
135  return m_dbContainer->insertItem( data.address(), objType );
136 }
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
int ora::Container::insertItem ( const void *  data,
const std::type_info &  typeInfo 
)
private

Definition at line 138 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

139  {
141  return m_dbContainer->insertItem( data, type );
142 }
type
Definition: HCALResponse.h:21
edm::TypeWithDict lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:170
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
bool ora::Container::isLocked ( )

Definition at line 125 of file Container.cc.

125  {
126  return m_dbContainer->isLocked();
127 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
ora::ContainerIterator ora::Container::iterator ( )

Definition at line 94 of file Container.cc.

94  {
95  Handle<IteratorBuffer> buff = m_dbContainer->iteratorBuffer();
96  return ContainerIterator( buff );
97 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
bool ora::Container::lock ( )

Definition at line 121 of file Container.cc.

121  {
122  return m_dbContainer->lock();
123 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
const std::string & ora::Container::mappingVersion ( )

Definition at line 86 of file Container.cc.

86  {
87  return m_dbContainer->mappingVersion();
88 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
const std::string & ora::Container::name ( )
ora::Container & ora::Container::operator= ( const Container rhs)

Definition at line 62 of file Container.cc.

References m_dbContainer.

62  {
63  if(this != &rhs ) m_dbContainer = rhs.m_dbContainer;
64  return *this;
65 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
std::string ora::Container::realClassName ( )

Definition at line 79 of file Container.cc.

References className(), ora::ClassUtils::demangledName(), ora::ClassUtils::lookupDictionary(), python.multivaluedict::remove(), run_regression::ret, AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::typeInfo().

Referenced by cond::DbSession::classNameForItem().

79  {
82  ret.erase( std::remove( ret.begin(), ret.end(), ' ' ), ret.end() );
83  return ret;
84 }
type
Definition: HCALResponse.h:21
const std::string & className()
Definition: Container.cc:75
std::string demangledName(const std::type_info &typeInfo)
Definition: ClassUtils.cc:159
std::type_info const & typeInfo() const
edm::TypeWithDict lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:170
void ora::Container::setAccessPermission ( const std::string &  principal,
bool  forWrite 
)

Definition at line 104 of file Container.cc.

105  {
106  m_dbContainer->setAccessPermission( principal, forWrite );
107 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
void ora::Container::setItemName ( const std::string &  name,
int  itemId 
)

Definition at line 169 of file Container.cc.

170  {
171  m_dbContainer->setItemName( name, itemId );
172 }
const std::string & name()
Definition: Container.cc:71
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
size_t ora::Container::size ( void  )

Definition at line 90 of file Container.cc.

90  {
91  return m_dbContainer->size();
92 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
template<typename T >
void ora::Container::update ( int  itemId,
const T data 
)
inline

Definition at line 141 of file Container.h.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), python.seqvaluedict.seqdict::__setslice__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.seqvaluedict.seqdict::extend(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), ora::Database::update(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

141  {
142  return updateItem( itemId, &data, typeid( data ) );
143 }
void updateItem(int itemId, const Object &data)
Definition: Container.cc:144
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void ora::Container::updateItem ( int  itemId,
const Object data 
)

Definition at line 144 of file Container.cc.

References ora::Object::address(), ora::throwException(), and ora::Object::type().

Referenced by ora::Database::updateItem().

145  {
146  const edm::TypeWithDict& objType = data.type();
147  if(!objType){
148  throwException("Object class has not been found in the dictionary.",
149  "Container::updateItem");
150  }
151  return m_dbContainer->updateItem( itemId, data.address(), objType );
152 }
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110
void ora::Container::updateItem ( int  itemId,
const void *  data,
const std::type_info &  typeInfo 
)
private

Definition at line 154 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

156  {
158  m_dbContainer->updateItem( itemId, data, type );
159 }
type
Definition: HCALResponse.h:21
edm::TypeWithDict lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:170
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:110

Member Data Documentation

Handle<DatabaseContainer> ora::Container::m_dbContainer
private

Definition at line 110 of file Container.h.

Referenced by operator=().