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

#include <QueryableVectorStreamer.h>

Inheritance diagram for ora::QueryableVectorReader:
ora::IRelationalReader

Public Member Functions

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

Private Attributes

DataElementm_dataElement
 
std::vector< boost::shared_ptr
< IVectorLoader > > 
m_loaders
 
MappingElementm_mapping
 
edm::TypeWithDict m_objectType
 
ContainerSchemam_schema
 
std::vector< int > m_tmpIds
 

Detailed Description

Definition at line 59 of file QueryableVectorStreamer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 429 of file QueryableVectorStreamer.cc.

431  :
432  m_objectType(objectType),
433  m_mapping( mapping ),
434  m_schema( contSchema ),
435  m_dataElement( 0 ),
436  m_loaders(),
437  m_tmpIds(){
438 }
std::vector< boost::shared_ptr< IVectorLoader > > m_loaders
ora::QueryableVectorReader::~QueryableVectorReader ( )
virtual

Definition at line 440 of file QueryableVectorStreamer.cc.

440  {
441  for(std::vector<boost::shared_ptr<IVectorLoader> >::const_iterator iL = m_loaders.begin();
442  iL != m_loaders.end(); ++iL ){
443  (*iL)->invalidate();
444  }
445 }
std::vector< boost::shared_ptr< IVectorLoader > > m_loaders

Member Function Documentation

bool ora::QueryableVectorReader::build ( DataElement offset,
IRelationalData relationalData 
)
virtual

Implements ora::IRelationalReader.

Definition at line 447 of file QueryableVectorStreamer.cc.

References ora::DataElement::clear().

Referenced by psClasses.BuildThread::run().

448  {
449  m_dataElement = &dataElement;
450  m_tmpIds.clear();
451  m_tmpIds.push_back(0);
452  return true;
453 }
void ora::QueryableVectorReader::clear ( void  )
virtual
void ora::QueryableVectorReader::read ( void *  address)
virtual

Reads a data element.

Implements ora::IRelationalReader.

Definition at line 466 of file QueryableVectorStreamer.cc.

References ora::DataElement::addChild(), ora::DataElement::address(), edm::MemberWithDict::offset(), and ora::throwException().

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

466  {
467  if(!m_dataElement){
468  throwException("The streamer has not been built.",
469  "QueryableVectorReader::read");
470  }
471 
472  // finding the address (on the instance) where to install the loader
473  edm::MemberWithDict loaderMember = m_objectType.dataMemberByName("m_loader");
474  if(!loaderMember){
475  throwException("The loader member has not been found.",
476  "QueryableVectorReader::read");
477  }
478  DataElement& loaderMemberElement = m_dataElement->addChild( loaderMember.offset(), 0 );
479  void* loaderAddress = loaderMemberElement.address( destinationData );
480 
481  // creating and registering the new loader to assign
482  boost::shared_ptr<IVectorLoader> loader( new QueryableVectorLoader( m_objectType, m_mapping, m_schema, m_tmpIds ) );
483  m_loaders.push_back(loader);
484  // installing the loader
485  *(static_cast<boost::shared_ptr<IVectorLoader>*>( loaderAddress )) = loader;
486 }
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:49
size_t offset() const
MemberWithDict dataMemberByName(std::string const &) const
std::vector< boost::shared_ptr< IVectorLoader > > m_loaders
DataElement & addChild(size_t declaringScopeOffset, size_toffset)
Definition: DataElement.cc:27
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
void ora::QueryableVectorReader::select ( int  oid)
virtual
void ora::QueryableVectorReader::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalReader.

Definition at line 459 of file QueryableVectorStreamer.cc.

References i.

459  {
460  m_tmpIds.resize( 1+identity.size() );
461  for( size_t i=0;i<identity.size();i++){
462  m_tmpIds[1+i] = identity[i];
463  }
464 }
int i
Definition: DBlmapReader.cc:9

Member Data Documentation

DataElement* ora::QueryableVectorReader::m_dataElement
private

Definition at line 78 of file QueryableVectorStreamer.h.

std::vector<boost::shared_ptr<IVectorLoader> > ora::QueryableVectorReader::m_loaders
private

Definition at line 79 of file QueryableVectorStreamer.h.

MappingElement& ora::QueryableVectorReader::m_mapping
private

Definition at line 76 of file QueryableVectorStreamer.h.

edm::TypeWithDict ora::QueryableVectorReader::m_objectType
private

Definition at line 75 of file QueryableVectorStreamer.h.

ContainerSchema& ora::QueryableVectorReader::m_schema
private

Definition at line 77 of file QueryableVectorStreamer.h.

std::vector<int> ora::QueryableVectorReader::m_tmpIds
private

Definition at line 80 of file QueryableVectorStreamer.h.