#include <PVectorStreamer.h>
Public Member Functions | |
bool | build (DataElement &offset, IRelationalData &relationalData, RelationalBuffer &operationBuffer) |
PVectorUpdater (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema) | |
Constructor. | |
void | setRecordId (const std::vector< int > &identity) |
void | update (int oid, const void *data) |
Updates a data element. | |
virtual | ~PVectorUpdater () |
Private Attributes | |
RelationalBuffer * | m_buffer |
STLContainerWriter | m_writer |
Definition at line 23 of file PVectorStreamer.h.
ora::PVectorUpdater::PVectorUpdater | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) |
Constructor.
Definition at line 31 of file PVectorStreamer.cc.
ora::PVectorUpdater::~PVectorUpdater | ( | ) | [virtual] |
Definition at line 38 of file PVectorStreamer.cc.
{ }
bool ora::PVectorUpdater::build | ( | DataElement & | offset, |
IRelationalData & | relationalData, | ||
RelationalBuffer & | operationBuffer | ||
) | [virtual] |
Implements ora::IRelationalUpdater.
Definition at line 41 of file PVectorStreamer.cc.
void ora::PVectorUpdater::setRecordId | ( | const std::vector< int > & | identity | ) | [virtual] |
Implements ora::IRelationalUpdater.
Definition at line 48 of file PVectorStreamer.cc.
{ m_writer.setRecordId( identity ); }
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().
{ if(!m_writer.dataElement()){ throwException("The streamer has not been built.", "PVectorUpdater::update"); } void* arrayData = m_writer.dataElement()->address( data ); IArrayHandler& arrayHandler = *m_writer.arrayHandler(); size_t arraySize = arrayHandler.size(arrayData); size_t* persistentSize = arrayHandler.persistentSize(arrayData); if(*persistentSize>arraySize){ deleteArrayElements( m_writer.mapping(), oid, arraySize, *m_buffer ); } else if(*persistentSize<arraySize) { m_writer.write( oid, data ); } *persistentSize = arraySize; }
RelationalBuffer* ora::PVectorUpdater::m_buffer [private] |
Definition at line 36 of file PVectorStreamer.h.
Definition at line 37 of file PVectorStreamer.h.