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 Attributes
ora::OraPtrUpdater Class Reference

#include <OraPtrStreamer.h>

Inheritance diagram for ora::OraPtrUpdater:
ora::IRelationalUpdater

Public Member Functions

bool build (DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
 
 OraPtrUpdater (const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
 
void setRecordId (const std::vector< int > &identity)
 
void update (int oid, const void *data)
 Updates a data element. More...
 
virtual ~OraPtrUpdater ()
 
- Public Member Functions inherited from ora::IRelationalUpdater
virtual ~IRelationalUpdater ()
 

Private Attributes

DataElementm_dataElement
 
DataElement m_localElement
 
MappingElementm_mappingElement
 
edm::TypeWithDict m_objectType
 
ContainerSchemam_schema
 
std::auto_ptr< IRelationalUpdaterm_updater
 

Detailed Description

Definition at line 45 of file OraPtrStreamer.h.

Constructor & Destructor Documentation

ora::OraPtrUpdater::OraPtrUpdater ( const edm::TypeWithDict objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 207 of file OraPtrStreamer.cc.

209  :
210  m_objectType( objectType ),
211  m_mappingElement( mapping ),
212  m_schema( contSchema ),
213  m_localElement(),
214  m_dataElement( 0 ),
215  m_updater(){
216 }
DataElement m_localElement
MappingElement & m_mappingElement
std::auto_ptr< IRelationalUpdater > m_updater
DataElement * m_dataElement
edm::TypeWithDict m_objectType
ContainerSchema & m_schema
ora::OraPtrUpdater::~OraPtrUpdater ( )
virtual

Definition at line 218 of file OraPtrStreamer.cc.

218  {
219 }

Member Function Documentation

bool ora::OraPtrUpdater::build ( DataElement dataElement,
IRelationalData relationalData,
RelationalBuffer operationBuffer 
)
virtual

Implements ora::IRelationalUpdater.

Definition at line 221 of file OraPtrStreamer.cc.

References ora::DataElement::clear(), edm::TypeWithDict::name(), ora::RelationalStreamerFactory::newUpdater(), ora::ClassUtils::resolvedType(), AlCaHLTBitMon_QueryRunRegistry::string, edm::TypeWithDict::templateArgumentAt(), and ora::throwException().

Referenced by psClasses.BuildThread::run().

223  {
224  m_dataElement = &dataElement;
226 
227  // Check the type
229  edm::TypeWithDict ptrResolvedType = ClassUtils::resolvedType(ptrType);
230  // Check the component type
231  if ( ! ptrType || !ptrResolvedType ) {
232  throwException( "Missing dictionary information for the type of the pointer \"" +
233  m_objectType.cppName() + "\"",
234  "OraPtrUpdater::build" );
235  }
236 
237  std::string ptrTypeName = ptrType.name();
238 // Retrieve the relevant mapping element
239  MappingElement::iterator iMe = m_mappingElement.find( ptrTypeName );
240  if ( iMe == m_mappingElement.end() ) {
241  throwException( "Item for \"" + ptrTypeName + "\" not found in the mapping element",
242  "OraPtrUpdater::build" );
243  }
244  RelationalStreamerFactory streamerFactory( m_schema );
245  m_updater.reset( streamerFactory.newUpdater( ptrResolvedType, iMe->second ) );
246  return m_updater->build( m_localElement, relationalData, operationBuffer );
247 }
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:483
DataElement m_localElement
MappingElement & m_mappingElement
TypeWithDict templateArgumentAt(size_t index) const
std::auto_ptr< IRelationalUpdater > m_updater
std::string name() const
std::string cppName() const
iterator find(const std::string &key)
Retrieves a sub-element.
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
DataElement * m_dataElement
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
iterator end()
Returns an iterator in the end of the sequence.
edm::TypeWithDict m_objectType
ContainerSchema & m_schema
void ora::OraPtrUpdater::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalUpdater.

Definition at line 249 of file OraPtrStreamer.cc.

249  {
250  m_updater->setRecordId( identity );
251 }
std::auto_ptr< IRelationalUpdater > m_updater
void ora::OraPtrUpdater::update ( int  oid,
const void *  data 
)
virtual

Updates a data element.

Writes a data element.

Implements ora::IRelationalUpdater.

Definition at line 254 of file OraPtrStreamer.cc.

References ora::throwException().

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(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

255  {
256  if(!m_dataElement){
257  throwException("The streamer has not been built.",
258  "OraPtrUpdater::update");
259  }
261  // first load if required
262  m_objectType.functionMemberByName("load").invoke(ptrObject, nullptr);
263  void *ptrAddress = nullptr;
264  edm::ObjectWithDict ptrAddrObj = edm::ObjectWithDict( edm::TypeWithDict(typeid(void*)), &ptrAddress );
265  m_objectType.functionMemberByName("address").invoke(ptrObject, &ptrAddrObj);
266  m_updater->update( oid, ptrAddress );
267 }
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:49
std::auto_ptr< IRelationalUpdater > m_updater
void invoke(ObjectWithDict const &obj, ObjectWithDict *ret=nullptr, std::vector< void * > const &values=std::vector< void * >()) const
Call a member function.
FunctionWithDict functionMemberByName(std::string const &) const
DataElement * m_dataElement
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
edm::TypeWithDict m_objectType
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82

Member Data Documentation

DataElement* ora::OraPtrUpdater::m_dataElement
private

Definition at line 67 of file OraPtrStreamer.h.

DataElement ora::OraPtrUpdater::m_localElement
private

Definition at line 66 of file OraPtrStreamer.h.

MappingElement& ora::OraPtrUpdater::m_mappingElement
private

Definition at line 64 of file OraPtrStreamer.h.

edm::TypeWithDict ora::OraPtrUpdater::m_objectType
private

Definition at line 63 of file OraPtrStreamer.h.

ContainerSchema& ora::OraPtrUpdater::m_schema
private

Definition at line 65 of file OraPtrStreamer.h.

std::auto_ptr<IRelationalUpdater> ora::OraPtrUpdater::m_updater
private

Definition at line 68 of file OraPtrStreamer.h.