#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 |
std::string | m_columnName |
DataElement * | m_dataElement |
Reflex::Type | m_objectType |
IRelationalData * | m_relationalData |
ContainerSchema & | m_schema |
Definition at line 70 of file BlobStreamer.h.
ora::BlobReader::BlobReader | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) |
Definition at line 116 of file BlobStreamer.cc.
References ora::MappingElement::columnNames(), and m_columnName.
: m_objectType( objectType ), m_columnName( "" ), m_schema( contSchema ), m_dataElement( 0 ), m_relationalData( 0 ), m_blobReader( 0 ){ if( mapping.columnNames().size() ){ m_columnName = mapping.columnNames()[0]; } }
ora::BlobReader::~BlobReader | ( | ) | [virtual] |
Definition at line 131 of file BlobStreamer.cc.
{ }
bool ora::BlobReader::build | ( | DataElement & | dataElement, |
IRelationalData & | relationalData | ||
) | [virtual] |
Implements ora::IRelationalReader.
Definition at line 134 of file BlobStreamer.cc.
References ora::IRelationalData::addBlobData(), and ora::throwException().
{ if( m_columnName.empty() ){ throwException( "Column name not found ", "BlobReader::build"); } m_dataElement = &dataElement; relationalData.addBlobData( m_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 159 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_columnName ]; 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 95 of file BlobStreamer.h.
std::string ora::BlobReader::m_columnName [private] |
Definition at line 89 of file BlobStreamer.h.
Referenced by BlobReader().
DataElement* ora::BlobReader::m_dataElement [private] |
Definition at line 93 of file BlobStreamer.h.
Reflex::Type ora::BlobReader::m_objectType [private] |
Definition at line 88 of file BlobStreamer.h.
IRelationalData* ora::BlobReader::m_relationalData [private] |
Definition at line 94 of file BlobStreamer.h.
ContainerSchema& ora::BlobReader::m_schema [private] |
Definition at line 90 of file BlobStreamer.h.