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)
 
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:108
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:108
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:108
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::DbSession::classNameForItem(), cond::IOVImportIterator::importMoreElements(), and cond::PoolTokenWriter::write().

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

Definition at line 154 of file Container.cc.

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

154  {
155  m_dbContainer->erase(itemId );
156 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
void ora::Container::extendSchema ( const std::type_info &  typeInfo)

Definition at line 92 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

92  {
94  m_dbContainer->extendSchema( type );
95 }
type
Definition: HCALResponse.h:22
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
Reflex::Type lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:93
template<typename T >
void ora::Container::extendSchema ( )
inline

Definition at line 121 of file Container.h.

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

Definition at line 127 of file Container.h.

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

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

Definition at line 102 of file Container.cc.

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

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

Definition at line 106 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

107  {
108  Reflex::Type asType = ClassUtils::lookupDictionary( asTypeInfo );
109  void* ptr = m_dbContainer->fetchItemAsType(itemId, asType );
110  if(!ptr) return boost::shared_ptr<void>();
111  return boost::shared_ptr<void>( ptr, RflxDeleter( m_dbContainer->type() ) );
112 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
Reflex::Type lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:93
void ora::Container::flush ( )

Definition at line 158 of file Container.cc.

158  {
159  m_dbContainer->flush();
160 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
bool ora::Container::getNames ( std::vector< std::string > &  destination)

Definition at line 167 of file Container.cc.

167  {
168  return m_dbContainer->getNames( destination );
169 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
int ora::Container::id ( void  )

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:108
template<typename T >
int ora::Container::insert ( const T data)
inline

Definition at line 133 of file Container.h.

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

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

Definition at line 122 of file Container.cc.

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

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

122  {
123  const Reflex::Type& objType = data.type();
124  if(!objType){
125  throwException("Object class has not been found in the dictionary.",
126  "Container::insertItem");
127  }
128  return m_dbContainer->insertItem( data.address(), objType );
129 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
int ora::Container::insertItem ( const void *  data,
const std::type_info &  typeInfo 
)
private

Definition at line 131 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

132  {
134  return m_dbContainer->insertItem( data, type );
135 }
type
Definition: HCALResponse.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
Reflex::Type lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:93
bool ora::Container::isLocked ( )

Definition at line 118 of file Container.cc.

118  {
119  return m_dbContainer->isLocked();
120 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
ora::ContainerIterator ora::Container::iterator ( )

Definition at line 87 of file Container.cc.

87  {
88  Handle<IteratorBuffer> buff = m_dbContainer->iteratorBuffer();
89  return ContainerIterator( buff );
90 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
bool ora::Container::lock ( )

Definition at line 114 of file Container.cc.

114  {
115  return m_dbContainer->lock();
116 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
const std::string & ora::Container::mappingVersion ( )

Definition at line 79 of file Container.cc.

79  {
80  return m_dbContainer->mappingVersion();
81 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
const std::string & ora::Container::name ( )

Definition at line 71 of file Container.cc.

Referenced by cond::DbSession::importObject(), Vispa.Views.PropertyView.Property::valueChanged(), and cond::PoolTokenWriter::write().

71  {
72  return m_dbContainer->name();
73 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
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:108
void ora::Container::setAccessPermission ( const std::string &  principal,
bool  forWrite 
)

Definition at line 97 of file Container.cc.

98  {
99  m_dbContainer->setAccessPermission( principal, forWrite );
100 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
void ora::Container::setItemName ( const std::string &  name,
int  itemId 
)

Definition at line 162 of file Container.cc.

163  {
164  m_dbContainer->setItemName( name, itemId );
165 }
const std::string & name()
Definition: Container.cc:71
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
size_t ora::Container::size ( void  )

Definition at line 83 of file Container.cc.

83  {
84  return m_dbContainer->size();
85 }
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
template<typename T >
void ora::Container::update ( int  itemId,
const T data 
)
inline

Definition at line 139 of file Container.h.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

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

Definition at line 137 of file Container.cc.

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

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

138  {
139  const Reflex::Type& objType = data.type();
140  if(!objType){
141  throwException("Object class has not been found in the dictionary.",
142  "Container::updateItem");
143  }
144  return m_dbContainer->updateItem( itemId, data.address(), objType );
145 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
void ora::Container::updateItem ( int  itemId,
const void *  data,
const std::type_info &  typeInfo 
)
private

Definition at line 147 of file Container.cc.

References ora::ClassUtils::lookupDictionary().

149  {
151  m_dbContainer->updateItem( itemId, data, type );
152 }
type
Definition: HCALResponse.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Handle< DatabaseContainer > m_dbContainer
Definition: Container.h:108
Reflex::Type lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
Definition: ClassUtils.cc:93

Member Data Documentation

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

Definition at line 108 of file Container.h.

Referenced by operator=().