2 #ifndef GAUDIKERNEL_OBJECTLIST_H
3 #define GAUDIKERNEL_OBJECTLIST_H
42 typedef typename std::list<TYPE*>::value_type
value_type;
47 typedef typename std::list<TYPE*>::iterator
iterator;
54 typedef typename std::vector<TYPE*>::_Tptr
pointer;
57 typedef typename std::vector<TYPE*>::pointer
pointer;
79 static CLID clid = TYPE::classID() + CLID_ObjectList;
166 if( 0 != value->parent() ) {
169 value->setParent(
this);
194 position->setParent (0);
206 for( iter =
begin(); iter !=
end(); iter++, idx++ ) {
207 if(
value == *iter ) {
211 if(
end() == iter ) {
219 (*iter)->setParent (0);
228 value->setParent(
this);
235 if( 0 != (*position)->parent() ) {
238 (*position)->setParent (0);
251 (*iter)->setParent (0);
255 m_list.erase(first, last);
268 for( iter =
begin(); iter !=
end(); iter++ ) {
281 for( iter =
begin(); iter !=
end(); iter++ ) {
292 s <<
"class ObjectList : size = "
298 s <<
"\nContents of the STL list :";
301 for( iter =
m_list.begin(); iter !=
m_list.end(); iter++, count++ ) {
305 <<
" of object of type "<< **iter;
318 #endif // GAUDI_OBJECTLIST_H
std::vector< TYPE * >::pointer pointer
ObjectList< TYPE >::const_reverse_iterator rend() const
Return a const_reverse_iterator pointing to the end of the reversed container.
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.
ObjectList< TYPE >::const_iterator begin() const
Return a const_iterator pointing to the beginning of the container.
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 >::const_reverse_iterator rbegin() const
Return a const_reverse_iterator pointing to the beginning of the reversed container.
ObjectList< TYPE >::reverse_iterator rbegin()
Return a reverse_iterator pointing to the beginning of the reversed container.
ObjectList< TYPE >::const_iterator end() const
Return a const_iterator pointing to the end of the 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.
ObjectList< TYPE >::const_reference back() const
Return const_reference to the last element.
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
std::list< TYPE * > m_list
The STL list.
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.
ObjectList(const ObjectList< TYPE > &value)
Copy Constructor.
std::list< TYPE * >::const_reverse_iterator const_reverse_iterator
virtual ~ObjectList()
Destructor.
virtual long add(ContainedObject *pObject)
Add an object to the container.
void erase(typename ObjectList< TYPE >::iterator first, typename ObjectList< TYPE >::iterator last)
Erase the range [first, last) from the container. The removed object will be deleted.
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)
ObjectList< TYPE >::const_reference front() const
Return const_reference to the first element.
ObjectList< TYPE >::iterator end()
Return an iterator pointing to the end of the container.