test
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 edm::TypeWithDict &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
 
edm::TypeWithDict 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 edm::TypeWithDict objectType,
MappingElement mapping,
ContainerSchema contSchema 
)

Definition at line 269 of file OraPtrStreamer.cc.

References m_readBuffer.

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

Definition at line 280 of file OraPtrStreamer.cc.

280  {
281  for(std::vector<boost::shared_ptr<IPtrLoader> >::const_iterator iL = m_loaders.begin();
282  iL != m_loaders.end(); ++iL ){
283  (*iL)->invalidate();
284  }
285 }
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 287 of file OraPtrStreamer.cc.

References ora::DataElement::clear().

Referenced by psClasses.BuildThread::run().

288  {
289  m_dataElement = &dataElement;
290  m_tmpIds.clear();
291  m_tmpIds.push_back(0);
292  return m_readBuffer->build( dataElement );
293 }
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 308 of file OraPtrStreamer.cc.

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

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

308  {
309  if(!m_dataElement){
310  throwException("The streamer has not been built.",
311  "OraPtrReader::read");
312  }
313  // resolving loader address
314  edm::MemberWithDict loaderMember = m_objectType.dataMemberByName("m_loader");
315  DataElement& loaderElement = m_dataElement->addChild( loaderMember.offset(), 0 );
316  void* loaderAddress = loaderElement.address( data );
317  boost::shared_ptr<IPtrLoader>* loaderPtr = static_cast<boost::shared_ptr<IPtrLoader>*>( loaderAddress );
318  // creating new loader
319  boost::shared_ptr<IPtrLoader> newLoader( new RelationalPtrLoader( *m_readBuffer, m_tmpIds ) );
320  m_loaders.push_back( newLoader );
321  // installing the new loader
322  *loaderPtr = newLoader;
323 }
std::vector< boost::shared_ptr< IPtrLoader > > m_loaders
void * address(const void *topLevelAddress) const
Definition: DataElement.cc:49
size_t offset() const
MemberWithDict dataMemberByName(std::string const &) const
DataElement * m_dataElement
edm::TypeWithDict m_objectType
DataElement & addChild(size_t declaringScopeOffset, size_toffset)
Definition: DataElement.cc:27
std::auto_ptr< OraPtrReadBuffer > m_readBuffer
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
std::vector< int > m_tmpIds
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void ora::OraPtrReader::select ( int  oid)
virtual
void ora::OraPtrReader::setRecordId ( const std::vector< int > &  identity)
virtual

Implements ora::IRelationalReader.

Definition at line 300 of file OraPtrStreamer.cc.

References i.

300  {
301  m_tmpIds.resize( 1+identity.size() );
302  for( size_t i=0;i<identity.size();i++){
303  m_tmpIds[1+i] = identity[i];
304  }
305 }
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.

edm::TypeWithDict 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.