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 );
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; }
379 bool DL_valid = e.dataLink().hasData();
394{
if(
m_it->previousEntry() == NULL )
m_dlv->chainEntry( &(*
m_it) ) ; }
402 return m_dlv->m_vect ;
442{
return ( (
id >=
m_vect.size() )
450 if ( idhash >=
m_vect.size() )
453 e.setOwnObject(flag);
464 if( !e->previousEntry() )
466 return e->dataLink();
482 Entry * tmp = e->previousEntry();
483 e->setPreviousEntry(NULL);
485 delete (e->dataLink()).getDataPtr();
486 e->dataLink().reset();
487 e->setOwnObject(
false);
505 e->setPreviousEntry(e);
509 e->setPreviousEntry(
m_last->previousEntry());
510 m_last->setPreviousEntry(e);
class DataHolder is a simple class which holds a pointer to an object of type DC.
pointer getDataPtr() const
access to pointer
void reset()
reset pointer to 0
const_pointer operator->() const
access to pointer
void setDataPtr(const DC *obj)
set pointer
const_pointer cptr() const
access to pointer
bool hasData() const
is pointer set
class Entry is a link in a chained list, used for efficient cleanup of vectors.
bool ownObject() const
ownObject is true if this object should be deleted by DLV.
void setDataLink(const DataLinkT &link)
set data link
DataLinkT & dataLink()
access to the DataLink
void setOwnObject(bool owns)
set object ownership
Entry * previousEntry()
access to next entry
Entry & operator=(const Entry &e)
assignement operator
void setPreviousEntry(Entry *entry)
set previous entry
class iterator - iterator over elements in DataLinkVector which manages the Entry objects
DataLinkT * operator->()
access to object by pointer
bool hasData()
test if DataHolder has data
DataLinkT & operator*()
access to object by ref
bool operator!=(const iterator it) const
comparison operator
EntryVector & entryVector()
protected method for derived class to access m_vect
iterator & operator++()
increment operator
bool operator==(const iterator it) const
comparison operator
iterator & operator=(const iterator it)
assignment operator
void checkChain()
make sure entry is chained If not, add entry to the chain otherwise do nothing because
void init(unsigned int nbr)
initialize vector with nbr DataLinks
void chainEntry(Entry *e) const
add pointed entry in chain of modified entries
DataLinkT & operator[](int id)
return reference on DataLink BEWARE: Doesn't check for boundary limits !
virtual void cleanup()
cleans up the DataLinkVector goes trough all chained entries and call clear() method of DataLink and ...
DataLinkVector()
Default constructor.
std::vector< Entry > EntryVector
const DC & const_reference
iterator end() const
return iterator on after last entry
DataLinkVector< DC > MyType
iterator find(IdentifierHash id) const
return iterator on the found entry or end() if out of range
~DataLinkVector()
Default destructor.
bool setObjectOwnership(IdentifierHash idhash, bool flag)
set object ownership
int size() const
access to size of vector
EntryVector::iterator EntryVectorIt
iterator begin() const
return iterator on first entry
This is a "hash" representation of an Identifier.