#include <OraPtrStreamer.h>
Public Member Functions | |
bool | build (DataElement &offset, IRelationalData &relationalData) |
void | clear () |
OraPtrReader (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema) | |
void | read (void *destination) |
Reads a data element. | |
void | select (int oid) |
void | setRecordId (const std::vector< int > &identity) |
virtual | ~OraPtrReader () |
Private Attributes | |
DataElement * | m_dataElement |
std::vector< boost::shared_ptr < IPtrLoader > > | m_loaders |
Reflex::Type | m_objectType |
std::auto_ptr< OraPtrReadBuffer > | m_readBuffer |
std::vector< int > | m_tmpIds |
Definition at line 71 of file OraPtrStreamer.h.
ora::OraPtrReader::OraPtrReader | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) |
Definition at line 266 of file OraPtrStreamer.cc.
References m_readBuffer.
: m_objectType( objectType ), m_dataElement( 0 ), m_readBuffer(), m_loaders(), m_tmpIds(){ m_readBuffer.reset( new OraPtrReadBuffer( objectType, mapping, contSchema )); }
ora::OraPtrReader::~OraPtrReader | ( | ) | [virtual] |
Definition at line 277 of file OraPtrStreamer.cc.
bool ora::OraPtrReader::build | ( | DataElement & | offset, |
IRelationalData & | relationalData | ||
) | [virtual] |
Implements ora::IRelationalReader.
Definition at line 284 of file OraPtrStreamer.cc.
References ora::DataElement::clear().
{ m_dataElement = &dataElement; m_tmpIds.clear(); m_tmpIds.push_back(0); return m_readBuffer->build( dataElement ); }
void ora::OraPtrReader::clear | ( | void | ) | [virtual] |
void ora::OraPtrReader::read | ( | void * | destination | ) | [virtual] |
Reads a data element.
Read a data element.
Implements ora::IRelationalReader.
Definition at line 305 of file OraPtrStreamer.cc.
References ora::DataElement::addChild(), ora::DataElement::address(), and ora::throwException().
{ if(!m_dataElement){ throwException("The streamer has not been built.", "OraPtrReader::read"); } // resolving loader address Reflex::Member loaderMember = m_objectType.MemberByName("m_loader"); DataElement& loaderElement = m_dataElement->addChild( loaderMember.Offset(), 0 ); void* loaderAddress = loaderElement.address( data ); boost::shared_ptr<IPtrLoader>* loaderPtr = static_cast<boost::shared_ptr<IPtrLoader>*>( loaderAddress ); // creating new loader boost::shared_ptr<IPtrLoader> newLoader( new RelationalPtrLoader( *m_readBuffer, m_tmpIds ) ); m_loaders.push_back( newLoader ); // installing the new loader *loaderPtr = newLoader; }
void ora::OraPtrReader::select | ( | int | oid | ) | [virtual] |
Implements ora::IRelationalReader.
Definition at line 292 of file OraPtrStreamer.cc.
References ora::throwException().
{ if(!m_dataElement) throwException( "The streamer has not been built.","OraPtrReader::select"); m_tmpIds[0] = oid; }
void ora::OraPtrReader::setRecordId | ( | const std::vector< int > & | identity | ) | [virtual] |
DataElement* ora::OraPtrReader::m_dataElement [private] |
Definition at line 93 of file OraPtrStreamer.h.
std::vector<boost::shared_ptr<IPtrLoader> > ora::OraPtrReader::m_loaders [private] |
Definition at line 95 of file OraPtrStreamer.h.
Reflex::Type ora::OraPtrReader::m_objectType [private] |
Definition at line 92 of file OraPtrStreamer.h.
std::auto_ptr<OraPtrReadBuffer> ora::OraPtrReader::m_readBuffer [private] |
Definition at line 94 of file OraPtrStreamer.h.
Referenced by OraPtrReader().
std::vector<int> ora::OraPtrReader::m_tmpIds [private] |
Definition at line 96 of file OraPtrStreamer.h.