CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::QueryableVectorReader Class Reference

#include <QueryableVectorStreamer.h>

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

List of all members.

Public Member Functions

bool build (DataElement &offset, IRelationalData &relationalData)
void clear ()
 QueryableVectorReader (const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
 Constructor.
void read (void *address)
 Reads a data element.
void select (int oid)
void setRecordId (const std::vector< int > &identity)
virtual ~QueryableVectorReader ()

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.

                                                                               :
  m_objectType(objectType),
  m_mapping( mapping ),
  m_schema( contSchema ),
  m_dataElement( 0 ),
  m_loaders(),
  m_tmpIds(){
}
ora::QueryableVectorReader::~QueryableVectorReader ( ) [virtual]

Definition at line 439 of file QueryableVectorStreamer.cc.

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

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().

                                                          {
  m_dataElement = &dataElement;
  m_tmpIds.clear();
  m_tmpIds.push_back(0);
  return true;
}
void ora::QueryableVectorReader::clear ( void  ) [virtual]

Implements ora::IRelationalReader.

Definition at line 487 of file QueryableVectorStreamer.cc.

                                    {
}
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().

                                                           {
  if(!m_dataElement){
    throwException("The streamer has not been built.",
                   "QueryableVectorReader::read");
  }

  // finding the address (on the instance) where to install the loader
  Reflex::Member loaderMember = m_objectType.DataMemberByName("m_loader");
  if(!loaderMember){
    throwException("The loader member has not been found.",
                   "QueryableVectorReader::read");     
  }
  DataElement& loaderMemberElement = m_dataElement->addChild( loaderMember.Offset(), 0 );
  void* loaderAddress = loaderMemberElement.address( destinationData );

  // creating and registering the new loader to assign
  boost::shared_ptr<IVectorLoader> loader( new QueryableVectorLoader( m_objectType, m_mapping, m_schema, m_tmpIds ) );
  m_loaders.push_back(loader);
  // installing the loader
  *(static_cast<boost::shared_ptr<IVectorLoader>*>( loaderAddress )) = loader;
}
void ora::QueryableVectorReader::select ( int  oid) [virtual]

Implements ora::IRelationalReader.

Definition at line 454 of file QueryableVectorStreamer.cc.

                                              {
  m_tmpIds[0] = oid;
}
void ora::QueryableVectorReader::setRecordId ( const std::vector< int > &  identity) [virtual]

Implements ora::IRelationalReader.

Definition at line 458 of file QueryableVectorStreamer.cc.

References i.

                                                                          {
  m_tmpIds.resize( 1+identity.size() );
  for( size_t i=0;i<identity.size();i++){
    m_tmpIds[1+i] = identity[i];
  }
}

Member Data Documentation

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.

Definition at line 76 of file QueryableVectorStreamer.h.

Definition at line 75 of file QueryableVectorStreamer.h.

Definition at line 77 of file QueryableVectorStreamer.h.

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

Definition at line 80 of file QueryableVectorStreamer.h.