1 #ifndef GAUDIKERNEL_OBJECTLIST_H
2 #define GAUDIKERNEL_OBJECTLIST_H
6 #include "GaudiKernel/Kernel.h"
7 #include "GaudiKernel/ClassID.h"
8 #include "GaudiKernel/StreamBuffer.h"
9 #include "GaudiKernel/ObjectContainerBase.h"
41 typedef typename std::list<TYPE*>::value_type
value_type;
46 typedef typename std::list<TYPE*>::iterator
iterator;
53 typedef typename std::vector<TYPE*>::_Tptr
pointer;
56 typedef typename std::vector<TYPE*>::pointer
pointer;
57 typedef typename std::vector<TYPE*>::const_pointer
const_pointer;
78 static CLID clid = TYPE::classID() + CLID_ObjectList;
139 bool empty ()
const {
165 if( 0 != value->parent() ) {
168 value->setParent(
this);
193 position->setParent (0);
205 for( iter =
begin(); iter !=
end(); iter++, idx++ ) {
206 if( value == *iter ) {
210 if(
end() == iter ) {
218 (*iter)->setParent (0);
227 value->setParent(
this);
234 if( 0 != (*position)->parent() ) {
237 (*position)->setParent (0);
250 (*iter)->setParent (0);
254 m_list.erase(first, last);
267 for( iter =
begin(); iter !=
end(); iter++ ) {
280 for( iter =
begin(); iter !=
end(); iter++ ) {
290 virtual std::ostream&
fillStream( std::ostream&
s )
const {
291 s <<
"class ObjectList : size = "
297 s <<
"\nContents of the STL list :";
300 for( iter =
m_list.begin(); iter !=
m_list.end(); iter++, count++ ) {
304 <<
" of object of type "<< **iter;
317 #endif // GAUDI_OBJECTLIST_H
std::vector< TYPE * >::pointer pointer
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
size_t size_type
size_type, to conform the STL container interface
void pop_back()
pop_back = remove the last element from the container The removed object will be deleted (see the met...
ObjectList< TYPE >::iterator insert(typename ObjectList< TYPE >::iterator position, typename ObjectList< TYPE >::const_reference value)
Insert "value" before "position".
ObjectList()
Constructors.
virtual ContainedObject * containedObject(long dist) const
Return const pointer to an object of a given distance.
bool empty() const
Return true if the size of the container is 0.
ObjectList< TYPE >::size_type size() const
Return the size of the container Size means the number of objects stored in the container, independently on the amount of information stored in each object.
std::list< TYPE * >::const_reference const_reference
std::list< TYPE * >::const_iterator const_iterator
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores...
std::list< TYPE * >::reverse_iterator reverse_iterator
std::list< TYPE * >::reference reference
std::list< TYPE * >::value_type value_type
virtual ObjectList< TYPE >::size_type numberOfObjects() const
The same as size(), return number of objects in the container.
ObjectList< TYPE >::reverse_iterator rbegin()
Return a reverse_iterator pointing to the beginning of the reversed container.
ObjectList< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
virtual long index(const ContainedObject *obj) const
Return distance of a given object from the beginning of its container It corresponds to the "index" (...
ObjectList< TYPE >::reverse_iterator rend()
Return a reverse_iterator pointing to the end of the reversed container.
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
unsigned int CLID
Class ID definition.
ObjectList< TYPE >::reference back()
Return reference to the last element.
std::list< TYPE * >::iterator iterator
static const CLID & classID()
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
ObjectList< TYPE >::reference front()
Return reference to the first element.
ObjectList< TYPE >::size_type max_size() const
Return the largest possible size of the container.
std::list< TYPE * >::const_reverse_iterator const_reverse_iterator
virtual ~ObjectList()
Destructor.
virtual long add(ContainedObject *pObject)
Add an object to the container.
void clear()
Clear the entire content of the container and delete all contained objects.
void push_back(typename ObjectList< TYPE >::const_reference value)
push_back = append = insert a new element at the end of the container
ObjectContainerBase is the base class for Gaudi container classes.
std::vector< TYPE * >::const_pointer const_pointer
void erase(typename ObjectList< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
TO * reference(FROM *from)
std::list< TYPE * > m_list
The STL list.
ObjectList< TYPE >::iterator end()
Return an iterator pointing to the end of the container.