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::QueryableVectorWriter Class Reference

#include <QueryableVectorStreamer.h>

Inheritance diagram for ora::QueryableVectorWriter:
ora::IRelationalWriter

Public Member Functions

bool build (DataElement &offset, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
 
 QueryableVectorWriter (const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
 Constructor. More...
 
void setRecordId (const std::vector< int > &identity)
 
void write (int oid, const void *data)
 Writes a data element. More...
 
virtual ~QueryableVectorWriter ()
 
- Public Member Functions inherited from ora::IRelationalWriter
virtual ~IRelationalWriter ()
 Destructor. More...
 

Private Attributes

DataElement m_localElement
 
edm::TypeWithDict m_objectType
 
DataElementm_offset
 
PVectorWriter m_writer
 

Detailed Description

Definition at line 21 of file QueryableVectorStreamer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 351 of file QueryableVectorStreamer.cc.

353  :
354  m_objectType( objectType ),
355  m_offset( 0 ),
356  m_localElement(),
357  m_writer(ClassUtils::containerSubType(objectType,"store_base_type"), mapping, contSchema ){
358 }
edm::TypeWithDict containerSubType(const edm::TypeWithDict &typ, const std::string &subTypeName)
Definition: ClassUtils.cc:468
ora::QueryableVectorWriter::~QueryableVectorWriter ( )
virtual

Definition at line 360 of file QueryableVectorStreamer.cc.

360  {
361 }

Member Function Documentation

bool ora::QueryableVectorWriter::build ( DataElement offset,
IRelationalData relationalData,
RelationalBuffer operationBuffer 
)
virtual

Implements ora::IRelationalWriter.

Definition at line 363 of file QueryableVectorStreamer.cc.

References hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by psClasses.BuildThread::run().

365  {
366  m_offset = &offset;
368  return m_writer.build( m_localElement, data, operationBuffer );
369 }
bool build(DataElement &offset, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
void ora::QueryableVectorWriter::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalWriter.

Definition at line 371 of file QueryableVectorStreamer.cc.

371  {
372  m_writer.setRecordId( identity );
373 }
void setRecordId(const std::vector< int > &identity)
void ora::QueryableVectorWriter::write ( int  oid,
const void *  data 
)
virtual

Writes a data element.

Implements ora::IRelationalWriter.

Definition at line 375 of file QueryableVectorStreamer.cc.

References ora::throwException().

Referenced by pkg.AbstractPkg::generate().

376  {
377  if(!m_offset){
378  throwException("The streamer has not been built.",
379  "QueryableVectorWriter::write");
380  }
381  void* vectorAddress = m_offset->address( inputData );
382  edm::ObjectWithDict vectorObj( m_objectType, const_cast<void*>(vectorAddress) );
383  m_objectType.functionMemberByName("load").invoke(vectorObj,nullptr);
384  void* storageAddress = nullptr;
385  edm::ObjectWithDict storAddObj = edm::ObjectWithDict( edm::TypeWithDict(typeid(void*)), &storageAddress );
386  m_objectType.functionMemberByName("storageAddress").invoke(vectorObj, &storAddObj);
387  m_writer.write( oid, storageAddress );
388 }
void write(int oid, const void *data)
Writes a data element.
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:49
void invoke(ObjectWithDict const &obj, ObjectWithDict *ret=nullptr, std::vector< void * > const &values=std::vector< void * >()) const
Call a member function.
FunctionWithDict functionMemberByName(std::string const &) const
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
tuple inputData
Definition: idDealer.py:72

Member Data Documentation

DataElement ora::QueryableVectorWriter::m_localElement
private

Definition at line 34 of file QueryableVectorStreamer.h.

edm::TypeWithDict ora::QueryableVectorWriter::m_objectType
private

Definition at line 32 of file QueryableVectorStreamer.h.

DataElement* ora::QueryableVectorWriter::m_offset
private

Definition at line 33 of file QueryableVectorStreamer.h.

PVectorWriter ora::QueryableVectorWriter::m_writer
private

Definition at line 36 of file QueryableVectorStreamer.h.