test
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::BlobReader Class Reference

#include <BlobStreamer.h>

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

Public Member Functions

 BlobReader (const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
 
bool build (DataElement &dataElement, IRelationalData &relationalData)
 
void clear ()
 
void read (void *data)
 Reads a data element. More...
 
void select (int oid)
 
void setRecordId (const std::vector< int > &identity)
 
virtual ~BlobReader ()
 
- Public Member Functions inherited from ora::IRelationalReader
virtual ~IRelationalReader ()
 

Private Attributes

IBlobStreamingServicem_blobReader
 
int m_columnIndex
 
DataElementm_dataElement
 
MappingElementm_mapping
 
edm::TypeWithDict m_objectType
 
IRelationalDatam_relationalData
 
ContainerSchemam_schema
 

Detailed Description

Definition at line 71 of file BlobStreamer.h.

Constructor & Destructor Documentation

ora::BlobReader::BlobReader ( const edm::TypeWithDict objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 114 of file BlobStreamer.cc.

116  :
117  m_objectType( objectType ),
118  m_mapping( mapping ),
119  m_columnIndex( -1 ),
120  m_schema( contSchema ),
121  m_dataElement( 0 ),
122  m_relationalData( 0 ),
123  m_blobReader( 0 ){
124 }
IBlobStreamingService * m_blobReader
Definition: BlobStreamer.h:97
DataElement * m_dataElement
Definition: BlobStreamer.h:95
edm::TypeWithDict m_objectType
Definition: BlobStreamer.h:89
IRelationalData * m_relationalData
Definition: BlobStreamer.h:96
MappingElement & m_mapping
Definition: BlobStreamer.h:90
ContainerSchema & m_schema
Definition: BlobStreamer.h:92
ora::BlobReader::~BlobReader ( )
virtual

Definition at line 126 of file BlobStreamer.cc.

126  {
127 }

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(), AlCaHLTBitMon_QueryRunRegistry::string, and ora::throwException().

Referenced by psClasses.BuildThread::run().

130  {
131 
132  if( m_mapping.columnNames().size() == 0 ){
133  throwException( "The mapping element does not contain columns.",
134  "BlobReader::build");
135  }
136 
137  m_dataElement = &dataElement;
138  std::string columnName = m_mapping.columnNames()[0];
139  m_columnIndex = relationalData.addBlobData( columnName );
140  m_relationalData = &relationalData;
142  if(!m_blobReader){
143  throwException("Blob Streaming Service is not installed.",
144  "BlobReader::build");
145  }
146  return true;
147 }
IBlobStreamingService * m_blobReader
Definition: BlobStreamer.h:97
DataElement * m_dataElement
Definition: BlobStreamer.h:95
const std::vector< std::string > & columnNames() const
IRelationalData * m_relationalData
Definition: BlobStreamer.h:96
MappingElement & m_mapping
Definition: BlobStreamer.h:90
ContainerSchema & m_schema
Definition: BlobStreamer.h:92
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
IBlobStreamingService * blobStreamingService()
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().

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

155  {
156  if( ! m_dataElement ){
157  throwException( "The streamer has not been built.",
158  "BlobReader::read");
159  }
160  void* dataElementAddress = m_dataElement->address( data );
161  coral::Attribute& relDataElement = m_relationalData->data()[ m_columnIndex ];
162  m_blobReader->read(relDataElement.data<coral::Blob>(), dataElementAddress, m_objectType );
163 }
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:49
IBlobStreamingService * m_blobReader
Definition: BlobStreamer.h:97
DataElement * m_dataElement
Definition: BlobStreamer.h:95
edm::TypeWithDict m_objectType
Definition: BlobStreamer.h:89
virtual coral::AttributeList & data()=0
IRelationalData * m_relationalData
Definition: BlobStreamer.h:96
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual void read(const coral::Blob &blobData, void *addressOfContainer, const edm::TypeWithDict &classDictionary)=0
Reads an object from a Blob and fills-in the container.
void ora::BlobReader::select ( int  oid)
virtual
void ora::BlobReader::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalReader.

Definition at line 152 of file BlobStreamer.cc.

152  {
153 }

Member Data Documentation

IBlobStreamingService* ora::BlobReader::m_blobReader
private

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.

edm::TypeWithDict 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.