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 204 of file OraPtrStreamer.cc.

206  :
207  m_objectType( objectType ),
208  m_mappingElement( mapping ),
209  m_schema( contSchema ),
210  m_localElement(),
211  m_dataElement( 0 ),
212  m_updater(){
213 }
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 215 of file OraPtrStreamer.cc.

215  {
216 }

Member Function Documentation

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

Implements ora::IRelationalUpdater.

Definition at line 218 of file OraPtrStreamer.cc.

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

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

Implements ora::IRelationalUpdater.

Definition at line 246 of file OraPtrStreamer.cc.

246  {
247  m_updater->setRecordId( identity );
248 }
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 251 of file OraPtrStreamer.cc.

References ora::throwException().

Referenced by python.seqvaluedict.seqdict::__setslice__(), python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.seqvaluedict.seqdict::extend(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

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.