#include <BlobStreamer.h>
Public Member Functions | |
void | bindData (const void *data) |
BlobWriterBase (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema) | |
bool | buildDataElement (DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer) |
virtual | ~BlobWriterBase () |
Private Attributes | |
IBlobStreamingService * | m_blobWriter |
std::string | m_columnName |
DataElement * | m_dataElement |
Reflex::Type | m_objectType |
RelationalBuffer * | m_relationalBuffer |
IRelationalData * | m_relationalData |
ContainerSchema & | m_schema |
bool | m_useCompression |
Definition at line 15 of file BlobStreamer.h.
ora::BlobWriterBase::BlobWriterBase | ( | const Reflex::Type & | objectType, |
MappingElement & | mapping, | ||
ContainerSchema & | contSchema | ||
) |
Definition at line 16 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_relationalBuffer( 0 ), m_blobWriter( 0 ), m_useCompression( true ){ if( mapping.columnNames().size() ){ m_columnName = mapping.columnNames()[0]; } }
ora::BlobWriterBase::~BlobWriterBase | ( | ) | [virtual] |
Definition at line 33 of file BlobStreamer.cc.
{ }
void ora::BlobWriterBase::bindData | ( | const void * | data | ) |
Definition at line 57 of file BlobStreamer.cc.
References ora::throwException().
{ if( ! m_dataElement ){ throwException( "The streamer has not been built.", "BlobWriterBase::bindData"); } void* dataElementAddress = m_dataElement->address( data ); coral::Attribute& relDataElement = m_relationalData->data()[ m_columnName ]; boost::shared_ptr<coral::Blob> blobData = m_blobWriter->write( dataElementAddress, m_objectType, m_useCompression ); m_relationalBuffer->storeBlob( blobData ); relDataElement.bind<coral::Blob>( *blobData ); }
bool ora::BlobWriterBase::buildDataElement | ( | DataElement & | dataElement, |
IRelationalData & | relationalData, | ||
RelationalBuffer & | operationBuffer | ||
) |
Definition at line 36 of file BlobStreamer.cc.
References ora::IRelationalData::addBlobData(), ora::poolSchemaVersion(), and ora::throwException().
{ if( m_columnName.empty() ){ throwException( "Column name not found ", "BlobWriterBase::build"); } m_dataElement = &dataElement; relationalData.addBlobData( m_columnName ); m_relationalData = &relationalData; m_relationalBuffer = &operationBuffer; m_blobWriter = m_schema.blobStreamingService(); if(!m_blobWriter){ throwException("Blob Streaming Service is not installed.", "BlobWriterBase::::build"); } if( m_schema.dbSession().schema().mainTable().schemaVersion()==poolSchemaVersion() ) m_useCompression = false; return true; }
Definition at line 35 of file BlobStreamer.h.
std::string ora::BlobWriterBase::m_columnName [private] |
Definition at line 28 of file BlobStreamer.h.
Referenced by BlobWriterBase().
DataElement* ora::BlobWriterBase::m_dataElement [private] |
Definition at line 32 of file BlobStreamer.h.
Reflex::Type ora::BlobWriterBase::m_objectType [private] |
Definition at line 27 of file BlobStreamer.h.
Definition at line 34 of file BlobStreamer.h.
Definition at line 33 of file BlobStreamer.h.
ContainerSchema& ora::BlobWriterBase::m_schema [private] |
Definition at line 29 of file BlobStreamer.h.
bool ora::BlobWriterBase::m_useCompression [private] |
Definition at line 36 of file BlobStreamer.h.