#include <QueryableVectorStreamer.h>
Public Member Functions | |
bool | build (DataElement &offset, IRelationalData &relationalData) |
void | clear () |
QueryableVectorReader (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema) | |
Constructor. | |
void | read (void *address) |
Reads a data element. | |
void | select (int oid) |
void | setRecordId (const std::vector< int > &identity) |
virtual | ~QueryableVectorReader () |
Private Attributes | |
DataElement * | m_dataElement |
std::vector< boost::shared_ptr < IVectorLoader > > | m_loaders |
MappingElement & | m_mapping |
Reflex::Type | m_objectType |
ContainerSchema & | m_schema |
std::vector< int > | m_tmpIds |
Definition at line 59 of file QueryableVectorStreamer.h.
ora::QueryableVectorReader::QueryableVectorReader | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) |
Constructor.
Definition at line 428 of file QueryableVectorStreamer.cc.
: m_objectType(objectType), m_mapping( mapping ), m_schema( contSchema ), m_dataElement( 0 ), m_loaders(), m_tmpIds(){ }
ora::QueryableVectorReader::~QueryableVectorReader | ( | ) | [virtual] |
Definition at line 439 of file QueryableVectorStreamer.cc.
bool ora::QueryableVectorReader::build | ( | DataElement & | offset, |
IRelationalData & | relationalData | ||
) | [virtual] |
Implements ora::IRelationalReader.
Definition at line 446 of file QueryableVectorStreamer.cc.
References ora::DataElement::clear().
{ m_dataElement = &dataElement; m_tmpIds.clear(); m_tmpIds.push_back(0); return true; }
void ora::QueryableVectorReader::clear | ( | void | ) | [virtual] |
void ora::QueryableVectorReader::read | ( | void * | address | ) | [virtual] |
Reads a data element.
Implements ora::IRelationalReader.
Definition at line 465 of file QueryableVectorStreamer.cc.
References ora::DataElement::addChild(), ora::DataElement::address(), and ora::throwException().
{ if(!m_dataElement){ throwException("The streamer has not been built.", "QueryableVectorReader::read"); } // finding the address (on the instance) where to install the loader Reflex::Member loaderMember = m_objectType.DataMemberByName("m_loader"); if(!loaderMember){ throwException("The loader member has not been found.", "QueryableVectorReader::read"); } DataElement& loaderMemberElement = m_dataElement->addChild( loaderMember.Offset(), 0 ); void* loaderAddress = loaderMemberElement.address( destinationData ); // creating and registering the new loader to assign boost::shared_ptr<IVectorLoader> loader( new QueryableVectorLoader( m_objectType, m_mapping, m_schema, m_tmpIds ) ); m_loaders.push_back(loader); // installing the loader *(static_cast<boost::shared_ptr<IVectorLoader>*>( loaderAddress )) = loader; }
void ora::QueryableVectorReader::select | ( | int | oid | ) | [virtual] |
Implements ora::IRelationalReader.
Definition at line 454 of file QueryableVectorStreamer.cc.
{ m_tmpIds[0] = oid; }
void ora::QueryableVectorReader::setRecordId | ( | const std::vector< int > & | identity | ) | [virtual] |
Definition at line 78 of file QueryableVectorStreamer.h.
std::vector<boost::shared_ptr<IVectorLoader> > ora::QueryableVectorReader::m_loaders [private] |
Definition at line 79 of file QueryableVectorStreamer.h.
Definition at line 76 of file QueryableVectorStreamer.h.
Reflex::Type ora::QueryableVectorReader::m_objectType [private] |
Definition at line 75 of file QueryableVectorStreamer.h.
Definition at line 77 of file QueryableVectorStreamer.h.
std::vector<int> ora::QueryableVectorReader::m_tmpIds [private] |
Definition at line 80 of file QueryableVectorStreamer.h.