#include <BlobStreamer.h>
Public Member Functions | |
BlobReader (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema) | |
bool | build (DataElement &dataElement, IRelationalData &relationalData) |
void | clear () |
void | read (void *data) |
Reads a data element. | |
void | select (int oid) |
void | setRecordId (const std::vector< int > &identity) |
virtual | ~BlobReader () |
Private Attributes | |
IBlobStreamingService * | m_blobReader |
int | m_columnIndex |
DataElement * | m_dataElement |
MappingElement & | m_mapping |
Reflex::Type | m_objectType |
IRelationalData * | m_relationalData |
ContainerSchema & | m_schema |
Definition at line 71 of file BlobStreamer.h.
ora::BlobReader::BlobReader | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) |
Definition at line 114 of file BlobStreamer.cc.
: m_objectType( objectType ), m_mapping( mapping ), m_columnIndex( -1 ), m_schema( contSchema ), m_dataElement( 0 ), m_relationalData( 0 ), m_blobReader( 0 ){ }
ora::BlobReader::~BlobReader | ( | ) | [virtual] |
Definition at line 126 of file BlobStreamer.cc.
{ }
bool ora::BlobReader::build | ( | DataElement & | dataElement, |
IRelationalData & | relationalData | ||
) | [virtual] |
Implements ora::IRelationalReader.
Definition at line 129 of file BlobStreamer.cc.
References ora::IRelationalData::addBlobData(), and ora::throwException().
{ if( m_mapping.columnNames().size() == 0 ){ throwException( "The mapping element does not contain columns.", "BlobReader::build"); } m_dataElement = &dataElement; std::string columnName = m_mapping.columnNames()[0]; m_columnIndex = relationalData.addBlobData( columnName ); m_relationalData = &relationalData; m_blobReader = m_schema.blobStreamingService(); if(!m_blobReader){ throwException("Blob Streaming Service is not installed.", "BlobReader::build"); } return true; }
void ora::BlobReader::clear | ( | void | ) | [virtual] |
void ora::BlobReader::read | ( | void * | address | ) | [virtual] |
Reads a data element.
Implements ora::IRelationalReader.
Definition at line 155 of file BlobStreamer.cc.
References ora::throwException().
{ if( ! m_dataElement ){ throwException( "The streamer has not been built.", "BlobReader::read"); } void* dataElementAddress = m_dataElement->address( data ); coral::Attribute& relDataElement = m_relationalData->data()[ m_columnIndex ]; m_blobReader->read(relDataElement.data<coral::Blob>(), dataElementAddress, m_objectType ); }
void ora::BlobReader::select | ( | int | oid | ) | [virtual] |
void ora::BlobReader::setRecordId | ( | const std::vector< int > & | identity | ) | [virtual] |
Definition at line 97 of file BlobStreamer.h.
int ora::BlobReader::m_columnIndex [private] |
Definition at line 91 of file BlobStreamer.h.
DataElement* ora::BlobReader::m_dataElement [private] |
Definition at line 95 of file BlobStreamer.h.
MappingElement& ora::BlobReader::m_mapping [private] |
Definition at line 90 of file BlobStreamer.h.
Reflex::Type ora::BlobReader::m_objectType [private] |
Definition at line 89 of file BlobStreamer.h.
IRelationalData* ora::BlobReader::m_relationalData [private] |
Definition at line 96 of file BlobStreamer.h.
ContainerSchema& ora::BlobReader::m_schema [private] |
Definition at line 92 of file BlobStreamer.h.