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 Reflex::Type &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
 
Reflex::Type 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 Reflex::Type &  objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 205 of file OraPtrStreamer.cc.

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

Definition at line 216 of file OraPtrStreamer.cc.

216  {
217 }

Member Function Documentation

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

Implements ora::IRelationalUpdater.

Definition at line 219 of file OraPtrStreamer.cc.

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

Referenced by psClasses.BuildThread::run().

221  {
222  m_dataElement = &dataElement;
224 
225  // Check the type
226  Reflex::Type ptrType = m_objectType.TemplateArgumentAt(0);
227  Reflex::Type ptrResolvedType = ClassUtils::resolvedType(ptrType);
228  // Check the component type
229  if ( ! ptrType || !ptrResolvedType ) {
230  throwException( "Missing dictionary information for the type of the pointer \"" +
231  m_objectType.Name(Reflex::SCOPED|Reflex::FINAL) + "\"",
232  "OraPtrUpdater::build" );
233  }
234 
235  std::string ptrTypeName = ptrType.Name();
236 // Retrieve the relevant mapping element
237  MappingElement::iterator iMe = m_mappingElement.find( ptrTypeName );
238  if ( iMe == m_mappingElement.end() ) {
239  throwException( "Item for \"" + ptrTypeName + "\" not found in the mapping element",
240  "OraPtrUpdater::build" );
241  }
242  RelationalStreamerFactory streamerFactory( m_schema );
243  m_updater.reset( streamerFactory.newUpdater( ptrResolvedType, iMe->second ) );
244  return m_updater->build( m_localElement, relationalData, operationBuffer );
245 }
DataElement m_localElement
MappingElement & m_mappingElement
std::auto_ptr< IRelationalUpdater > m_updater
Reflex::Type m_objectType
iterator find(const std::string &key)
Retrieves a sub-element.
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
Reflex::Type resolvedType(const Reflex::Type &typ)
Definition: ClassUtils.cc:404
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.
ContainerSchema & m_schema
void ora::OraPtrUpdater::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalUpdater.

Definition at line 247 of file OraPtrStreamer.cc.

247  {
248  m_updater->setRecordId( identity );
249 }
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 252 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().

253  {
254  if(!m_dataElement){
255  throwException("The streamer has not been built.",
256  "OraPtrUpdater::update");
257  }
258  Reflex::Object ptrObject( m_objectType, m_dataElement->address( data ) );
259  // first load if required
260  ptrObject.Invoke("load",0);
261  void* ptrAddress = 0;
262  ptrObject.Invoke("address",ptrAddress);
263  m_updater->update( oid, ptrAddress );
264 }
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:48
std::auto_ptr< IRelationalUpdater > m_updater
Reflex::Type m_objectType
DataElement * m_dataElement
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

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.

Reflex::Type 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.