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

#include <OraPtrStreamer.h>

Inheritance diagram for ora::OraPtrReader:
ora::IRelationalReader

Public Member Functions

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

Private Attributes

DataElementm_dataElement
 
std::vector< boost::shared_ptr
< IPtrLoader > > 
m_loaders
 
Reflex::Type m_objectType
 
std::auto_ptr< OraPtrReadBufferm_readBuffer
 
std::vector< int > m_tmpIds
 

Detailed Description

Definition at line 71 of file OraPtrStreamer.h.

Constructor & Destructor Documentation

ora::OraPtrReader::OraPtrReader ( const Reflex::Type &  objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 266 of file OraPtrStreamer.cc.

References m_readBuffer.

268  :
269  m_objectType( objectType ),
270  m_dataElement( 0 ),
271  m_readBuffer(),
272  m_loaders(),
273  m_tmpIds(){
274  m_readBuffer.reset( new OraPtrReadBuffer( objectType, mapping, contSchema ));
275 }
std::vector< boost::shared_ptr< IPtrLoader > > m_loaders
Reflex::Type m_objectType
DataElement * m_dataElement
std::auto_ptr< OraPtrReadBuffer > m_readBuffer
std::vector< int > m_tmpIds
ora::OraPtrReader::~OraPtrReader ( )
virtual

Definition at line 277 of file OraPtrStreamer.cc.

277  {
278  for(std::vector<boost::shared_ptr<IPtrLoader> >::const_iterator iL = m_loaders.begin();
279  iL != m_loaders.end(); ++iL ){
280  (*iL)->invalidate();
281  }
282 }
std::vector< boost::shared_ptr< IPtrLoader > > m_loaders

Member Function Documentation

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

Implements ora::IRelationalReader.

Definition at line 284 of file OraPtrStreamer.cc.

References ora::DataElement::clear().

285  {
286  m_dataElement = &dataElement;
287  m_tmpIds.clear();
288  m_tmpIds.push_back(0);
289  return m_readBuffer->build( dataElement );
290 }
DataElement * m_dataElement
std::auto_ptr< OraPtrReadBuffer > m_readBuffer
std::vector< int > m_tmpIds
void ora::OraPtrReader::clear ( void  )
virtual
void ora::OraPtrReader::read ( void *  destination)
virtual

Reads a data element.

Read a data element.

Implements ora::IRelationalReader.

Definition at line 305 of file OraPtrStreamer.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().

305  {
306  if(!m_dataElement){
307  throwException("The streamer has not been built.",
308  "OraPtrReader::read");
309  }
310  // resolving loader address
311  Reflex::Member loaderMember = m_objectType.MemberByName("m_loader");
312  DataElement& loaderElement = m_dataElement->addChild( loaderMember.Offset(), 0 );
313  void* loaderAddress = loaderElement.address( data );
314  boost::shared_ptr<IPtrLoader>* loaderPtr = static_cast<boost::shared_ptr<IPtrLoader>*>( loaderAddress );
315  // creating new loader
316  boost::shared_ptr<IPtrLoader> newLoader( new RelationalPtrLoader( *m_readBuffer, m_tmpIds ) );
317  m_loaders.push_back( newLoader );
318  // installing the new loader
319  *loaderPtr = newLoader;
320 }
std::vector< boost::shared_ptr< IPtrLoader > > m_loaders
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:48
Reflex::Type m_objectType
DataElement & addChild(size_t declaringScopeOffset, Reflex::OffsetFunction offsetFunction)
Definition: DataElement.cc:26
DataElement * m_dataElement
std::auto_ptr< OraPtrReadBuffer > m_readBuffer
std::vector< int > m_tmpIds
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
void ora::OraPtrReader::select ( int  oid)
virtual
void ora::OraPtrReader::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalReader.

Definition at line 297 of file OraPtrStreamer.cc.

References i.

297  {
298  m_tmpIds.resize( 1+identity.size() );
299  for( size_t i=0;i<identity.size();i++){
300  m_tmpIds[1+i] = identity[i];
301  }
302 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > m_tmpIds

Member Data Documentation

DataElement* ora::OraPtrReader::m_dataElement
private

Definition at line 93 of file OraPtrStreamer.h.

std::vector<boost::shared_ptr<IPtrLoader> > ora::OraPtrReader::m_loaders
private

Definition at line 95 of file OraPtrStreamer.h.

Reflex::Type ora::OraPtrReader::m_objectType
private

Definition at line 92 of file OraPtrStreamer.h.

std::auto_ptr<OraPtrReadBuffer> ora::OraPtrReader::m_readBuffer
private

Definition at line 94 of file OraPtrStreamer.h.

Referenced by OraPtrReader().

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

Definition at line 96 of file OraPtrStreamer.h.