CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::BlobReader Class Reference

#include <BlobStreamer.h>

Inheritance diagram for ora::BlobReader:
ora::IRelationalReader

List of all members.

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

IBlobStreamingServicem_blobReader
int m_columnIndex
DataElementm_dataElement
MappingElementm_mapping
Reflex::Type m_objectType
IRelationalDatam_relationalData
ContainerSchemam_schema

Detailed Description

Definition at line 71 of file BlobStreamer.h.


Constructor & Destructor Documentation

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.

                          {
}

Member Function Documentation

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]

Implements ora::IRelationalReader.

Definition at line 165 of file BlobStreamer.cc.

                         {
}
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]

Implements ora::IRelationalReader.

Definition at line 149 of file BlobStreamer.cc.

                               {
}
void ora::BlobReader::setRecordId ( const std::vector< int > &  identity) [virtual]

Implements ora::IRelationalReader.

Definition at line 152 of file BlobStreamer.cc.

                                                      {
}

Member Data Documentation

Definition at line 97 of file BlobStreamer.h.

Definition at line 91 of file BlobStreamer.h.

Definition at line 95 of file BlobStreamer.h.

Definition at line 90 of file BlobStreamer.h.

Reflex::Type ora::BlobReader::m_objectType [private]

Definition at line 89 of file BlobStreamer.h.

Definition at line 96 of file BlobStreamer.h.

Definition at line 92 of file BlobStreamer.h.