Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef EVENTCONTAINERS_DATALINKVECTOR_H
6 #define EVENTCONTAINERS_DATALINKVECTOR_H
17 #include "GaudiKernel/DataObject.h"
63 const_pointer
cptr()
const;
185 void init(
unsigned int nbr );
239 return this->getDataPtr();
246 return this->getDataPtr();
273 m_previousEntry(NULL),
282 m_dataLink =
e.m_dataLink ;
283 m_previousEntry =
e.m_previousEntry;
284 m_ownObject =
e.m_ownObject;
292 return m_previousEntry;
313 m_previousEntry =
entry;
340 {
return it.m_it != m_it; }
345 {
return it.m_it == m_it; }
350 { m_dlv =
it.m_dlv; m_it =
it.m_it;
return *
this; }
355 { ++m_it;
return *
this; }
360 {
return iterator( m_dlv, m_it++ ); }
365 { checkChain();
return m_it->dataLink(); }
370 { checkChain();
return &m_it->dataLink(); }
379 bool DL_valid =
e.dataLink().hasData();
386 : m_dlv(dlv), m_it(
it) {}
394 {
if( m_it->previousEntry() == NULL ) m_dlv->chainEntry( &(*m_it) ) ; }
402 return m_dlv->m_vect ;
430 {
return iterator(
this, m_vect.begin() ); }
436 {
return iterator(
this, m_vect.end()); }
442 {
return ( (
id >= m_vect.size() )
450 if ( idhash >= m_vect.size() )
452 Entry&
e = *(m_vect.begin()+idhash);
453 e.setOwnObject(
flag);
464 if( !
e->previousEntry() )
466 return e->dataLink();
483 e->setPreviousEntry(NULL);
485 delete (
e->dataLink()).getDataPtr();
486 e->dataLink().reset();
487 e->setOwnObject(
false);
489 }
while(
e != m_last );
497 return m_vect.size();
504 if( m_last == NULL ) {
505 e->setPreviousEntry(
e);
509 e->setPreviousEntry(m_last->previousEntry());
510 m_last->setPreviousEntry(
e);
JetConstituentVector::iterator iterator
bool hasData()
test if DataHolder has data
iterator begin() const
return iterator on first entry
Entry * previousEntry()
access to next entry
iterator find(IdentifierHash id) const
return iterator on the found entry or end() if out of range
DataLinkT * operator->()
access to object by pointer
This class is a a vector of DataLink for objects of type DC It uses an internal chain to keep track o...
EntryVector::iterator EntryVectorIt
void init(unsigned int nbr)
initialize vector with nbr DataLinks
void chainEntry(Entry *e) const
add pointed entry in chain of modified entries
void reset()
reset pointer to 0
iterator & operator=(const iterator it)
assignment operator
const_pointer operator->() const
access to pointer
class Entry is a link in a chained list, used for efficient cleanup of vectors.
EntryVector & entryVector()
protected method for derived class to access m_vect
DataLinkT & operator*()
access to object by ref
bool ownObject() const
ownObject is true if this object should be deleted by DLV.
void setPreviousEntry(Entry *entry)
set previous entry
class iterator - iterator over elements in DataLinkVector which manages the Entry objects
pointer getDataPtr() const
access to pointer
void setDataLink(const DataLinkT &link)
set data link
const_pointer cptr() const
access to pointer
DataLinkVector()
Default constructor.
class DataHolder is a simple class which holds a pointer to an object of type DC.
bool operator==(const iterator it) const
comparison operator
void setOwnObject(bool owns)
set object ownership
virtual void cleanup()
cleans up the DataLinkVector goes trough all chained entries and call clear() method of DataLink and ...
void setDataPtr(const DC *obj)
set pointer
bool setObjectOwnership(IdentifierHash idhash, bool flag)
set object ownership
Entry & operator=(const Entry &e)
assignement operator
int size() const
access to size of vector
iterator & operator++()
increment operator
DataLinkT & operator[](int id)
return reference on DataLink BEWARE: Doesn't check for boundary limits !
DataLinkT & dataLink()
access to the DataLink
DataLinkVector< DC > MyType
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
bool hasData() const
is pointer set
iterator end() const
return iterator on after last entry
std::vector< Entry > EntryVector
const DC & const_reference
~DataLinkVector()
Default destructor.
void checkChain()
make sure entry is chained If not, add entry to the chain otherwise do nothing because
bool operator!=(const iterator it) const
comparison operator