CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::BlobWriterBase Class Reference

#include <BlobStreamer.h>

Inheritance diagram for ora::BlobWriterBase:
ora::BlobUpdater ora::BlobWriter

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

IBlobStreamingServicem_blobWriter
 
int m_columnIndex
 
DataElementm_dataElement
 
MappingElementm_mapping
 
Reflex::Type m_objectType
 
RelationalBufferm_relationalBuffer
 
IRelationalDatam_relationalData
 
ContainerSchemam_schema
 
bool m_useCompression
 

Detailed Description

Definition at line 15 of file BlobStreamer.h.

Constructor & Destructor Documentation

ora::BlobWriterBase::BlobWriterBase ( const Reflex::Type &  objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 16 of file BlobStreamer.cc.

18  :
19  m_objectType( objectType ),
20  m_mapping( mapping ),
21  m_columnIndex(-1),
22  m_schema( contSchema ),
23  m_dataElement( 0 ),
24  m_relationalData( 0 ),
25  m_relationalBuffer( 0 ),
26  m_blobWriter( 0 ),
27  m_useCompression( true ){
28 }
IRelationalData * m_relationalData
Definition: BlobStreamer.h:34
MappingElement & m_mapping
Definition: BlobStreamer.h:28
Reflex::Type m_objectType
Definition: BlobStreamer.h:27
DataElement * m_dataElement
Definition: BlobStreamer.h:33
IBlobStreamingService * m_blobWriter
Definition: BlobStreamer.h:36
ContainerSchema & m_schema
Definition: BlobStreamer.h:30
RelationalBuffer * m_relationalBuffer
Definition: BlobStreamer.h:35
ora::BlobWriterBase::~BlobWriterBase ( )
virtual

Definition at line 30 of file BlobStreamer.cc.

30  {
31 }

Member Function Documentation

void ora::BlobWriterBase::bindData ( const void *  data)

Definition at line 55 of file BlobStreamer.cc.

References ora::throwException().

55  {
56  if( ! m_dataElement ){
57  throwException( "The streamer has not been built.",
58  "BlobWriterBase::bindData");
59  }
60  void* dataElementAddress = m_dataElement->address( data );
61  coral::Attribute& relDataElement = m_relationalData->data()[ m_columnIndex ];
62  boost::shared_ptr<coral::Blob> blobData = m_blobWriter->write( dataElementAddress, m_objectType, m_useCompression );
63  m_relationalBuffer->storeBlob( blobData );
64  relDataElement.bind<coral::Blob>( *blobData );
65 }
IRelationalData * m_relationalData
Definition: BlobStreamer.h:34
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:48
Reflex::Type m_objectType
Definition: BlobStreamer.h:27
virtual coral::AttributeList & data()=0
DataElement * m_dataElement
Definition: BlobStreamer.h:33
IBlobStreamingService * m_blobWriter
Definition: BlobStreamer.h:36
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
RelationalBuffer * m_relationalBuffer
Definition: BlobStreamer.h:35
void storeBlob(boost::shared_ptr< coral::Blob > blob)
virtual boost::shared_ptr< coral::Blob > write(const void *addressOfInputData, const Reflex::Type &classDictionary, bool useCompression=true)=0
bool ora::BlobWriterBase::buildDataElement ( DataElement dataElement,
IRelationalData relationalData,
RelationalBuffer operationBuffer 
)

Definition at line 33 of file BlobStreamer.cc.

References ora::IRelationalData::addBlobData(), ora::poolSchemaVersion(), AlCaHLTBitMon_QueryRunRegistry::string, and ora::throwException().

35  {
36  if( m_mapping.columnNames().size() == 0 ){
37  throwException( "The mapping element does not contain columns.",
38  "BlobWriterBase::build");
39  }
40 
41  m_dataElement = &dataElement;
42  std::string columnName = m_mapping.columnNames()[0];
43  m_columnIndex = relationalData.addBlobData( columnName );
44  m_relationalData = &relationalData;
45  m_relationalBuffer = &operationBuffer;
47  if(!m_blobWriter){
48  throwException("Blob Streaming Service is not installed.",
49  "BlobWriterBase::::build");
50  }
52  return true;
53 }
IRelationalData * m_relationalData
Definition: BlobStreamer.h:34
virtual std::string schemaVersion()=0
MappingElement & m_mapping
Definition: BlobStreamer.h:28
IDatabaseSchema & schema()
std::string poolSchemaVersion()
const std::vector< std::string > & columnNames() const
DatabaseSession & dbSession()
DataElement * m_dataElement
Definition: BlobStreamer.h:33
IBlobStreamingService * m_blobWriter
Definition: BlobStreamer.h:36
ContainerSchema & m_schema
Definition: BlobStreamer.h:30
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
RelationalBuffer * m_relationalBuffer
Definition: BlobStreamer.h:35
IBlobStreamingService * blobStreamingService()
virtual IMainTable & mainTable()=0

Member Data Documentation

IBlobStreamingService* ora::BlobWriterBase::m_blobWriter
private

Definition at line 36 of file BlobStreamer.h.

int ora::BlobWriterBase::m_columnIndex
private

Definition at line 29 of file BlobStreamer.h.

DataElement* ora::BlobWriterBase::m_dataElement
private

Definition at line 33 of file BlobStreamer.h.

MappingElement& ora::BlobWriterBase::m_mapping
private

Definition at line 28 of file BlobStreamer.h.

Reflex::Type ora::BlobWriterBase::m_objectType
private

Definition at line 27 of file BlobStreamer.h.

RelationalBuffer* ora::BlobWriterBase::m_relationalBuffer
private

Definition at line 35 of file BlobStreamer.h.

IRelationalData* ora::BlobWriterBase::m_relationalData
private

Definition at line 34 of file BlobStreamer.h.

ContainerSchema& ora::BlobWriterBase::m_schema
private

Definition at line 30 of file BlobStreamer.h.

bool ora::BlobWriterBase::m_useCompression
private

Definition at line 37 of file BlobStreamer.h.