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 Reflex::Type &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
 
Reflex::Type 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 Reflex::Type &  objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Constructor.

Definition at line 428 of file QueryableVectorStreamer.cc.

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

Definition at line 439 of file QueryableVectorStreamer.cc.

439  {
440  for(std::vector<boost::shared_ptr<IVectorLoader> >::const_iterator iL = m_loaders.begin();
441  iL != m_loaders.end(); ++iL ){
442  (*iL)->invalidate();
443  }
444 }
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 446 of file QueryableVectorStreamer.cc.

References ora::DataElement::clear().

Referenced by psClasses.BuildThread::run().

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

Reads a data element.

Implements ora::IRelationalReader.

Definition at line 465 of file QueryableVectorStreamer.cc.

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

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

465  {
466  if(!m_dataElement){
467  throwException("The streamer has not been built.",
468  "QueryableVectorReader::read");
469  }
470 
471  // finding the address (on the instance) where to install the loader
472  Reflex::Member loaderMember = m_objectType.DataMemberByName("m_loader");
473  if(!loaderMember){
474  throwException("The loader member has not been found.",
475  "QueryableVectorReader::read");
476  }
477  DataElement& loaderMemberElement = m_dataElement->addChild( loaderMember.Offset(), 0 );
478  void* loaderAddress = loaderMemberElement.address( destinationData );
479 
480  // creating and registering the new loader to assign
481  boost::shared_ptr<IVectorLoader> loader( new QueryableVectorLoader( m_objectType, m_mapping, m_schema, m_tmpIds ) );
482  m_loaders.push_back(loader);
483  // installing the loader
484  *(static_cast<boost::shared_ptr<IVectorLoader>*>( loaderAddress )) = loader;
485 }
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:48
DataElement & addChild(size_t declaringScopeOffset, Reflex::OffsetFunction offsetFunction)
Definition: DataElement.cc:26
std::vector< boost::shared_ptr< IVectorLoader > > m_loaders
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 458 of file QueryableVectorStreamer.cc.

References i.

458  {
459  m_tmpIds.resize( 1+identity.size() );
460  for( size_t i=0;i<identity.size();i++){
461  m_tmpIds[1+i] = identity[i];
462  }
463 }
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.

Reflex::Type 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.