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::PVectorUpdater Class Reference

#include <PVectorStreamer.h>

Inheritance diagram for ora::PVectorUpdater:
ora::IRelationalUpdater

Public Member Functions

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

Private Attributes

RelationalBufferm_buffer
 
STLContainerWriter m_writer
 

Detailed Description

Definition at line 23 of file PVectorStreamer.h.

Constructor & Destructor Documentation

ora::PVectorUpdater::PVectorUpdater ( const Reflex::Type &  objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Constructor.

Definition at line 31 of file PVectorStreamer.cc.

33  :
34  m_buffer(0),
35  m_writer( objectType, mapping, contSchema ){
36 }
STLContainerWriter m_writer
RelationalBuffer * m_buffer
ora::PVectorUpdater::~PVectorUpdater ( )
virtual

Definition at line 38 of file PVectorStreamer.cc.

38  {
39 }

Member Function Documentation

bool ora::PVectorUpdater::build ( DataElement offset,
IRelationalData relationalData,
RelationalBuffer operationBuffer 
)
virtual

Implements ora::IRelationalUpdater.

Definition at line 41 of file PVectorStreamer.cc.

Referenced by psClasses.BuildThread::run().

43  {
44  m_buffer = &operationBuffer;
45  return m_writer.build( offset, relationalData, operationBuffer );
46 }
bool build(DataElement &offset, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
unsigned int offset(bool)
STLContainerWriter m_writer
RelationalBuffer * m_buffer
void ora::PVectorUpdater::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalUpdater.

Definition at line 48 of file PVectorStreamer.cc.

48  {
49  m_writer.setRecordId( identity );
50 }
void setRecordId(const std::vector< int > &identity)
STLContainerWriter m_writer
void ora::PVectorUpdater::update ( int  oid,
const void *  data 
)
virtual

Updates a data element.

Implements ora::IRelationalUpdater.

Definition at line 52 of file PVectorStreamer.cc.

References ora::deleteArrayElements(), ora::IArrayHandler::persistentSize(), ora::IArrayHandler::size(), and 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().

53  {
54  if(!m_writer.dataElement()){
55  throwException("The streamer has not been built.",
56  "PVectorUpdater::update");
57  }
58 
59  void* arrayData = m_writer.dataElement()->address( data );
60  IArrayHandler& arrayHandler = *m_writer.arrayHandler();
61 
62  size_t arraySize = arrayHandler.size(arrayData);
63  size_t* persistentSize = arrayHandler.persistentSize(arrayData);
64  if(*persistentSize>arraySize){
65  deleteArrayElements( m_writer.mapping(), oid, arraySize, *m_buffer );
66  }
67  else if(*persistentSize<arraySize) {
68  m_writer.write( oid, data );
69  }
70  *persistentSize = arraySize;
71 }
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:48
virtual size_t size(const void *address)=0
Returns the size of the container.
void deleteArrayElements(MappingElement &mapping, int oid, int fromIndex, RelationalBuffer &buffer)
void write(int oid, const void *data)
Writes a data element.
STLContainerWriter m_writer
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
RelationalBuffer * m_buffer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
IArrayHandler * arrayHandler()

Member Data Documentation

RelationalBuffer* ora::PVectorUpdater::m_buffer
private

Definition at line 36 of file PVectorStreamer.h.

STLContainerWriter ora::PVectorUpdater::m_writer
private

Definition at line 37 of file PVectorStreamer.h.