2 #ifndef GAUDIKERNEL_OBJECTVECTOR_H
3 #define GAUDIKERNEL_OBJECTVECTOR_H
43 typedef typename std::vector<TYPE*>::value_type
value_type;
48 typedef typename std::vector<TYPE*>::iterator
iterator;
54 typedef typename std::vector<TYPE*>::_Tptr
pointer;
57 typedef typename std::vector<TYPE*>::pointer
pointer;
87 static CLID clid = TYPE::classID() + CLID_ObjectVector;
200 if( 0 != value->parent() ) {
203 value->setParent(
this);
228 position->setParent (0);
239 for( i =
begin(); i !=
end(); i++ ) {
261 value->setParent(
this);
268 if( 0 != (*position)->parent() ) {
271 (*position)->setParent (0);
313 for( i = 0; i < (long)
m_vector.size(); i++ ) {
328 s <<
"class ObjectVector : size = "
334 s <<
"\nContents of the STL vector :";
341 <<
" of object of type " << **iter;
352 #endif // GAUDIKERNEL_OBJECTVECTOR_H
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
void clear()
Clear the entire content of the container and delete all contained objects.
virtual long index(const ContainedObject *obj) const
Return distance of a given object from the beginning of its container It correcponds to the "index" (...
const ObjectVector< TYPE > & operator=(const ObjectVector< TYPE > &right)
Clone operator.
size_t size_type
size_type, to conform the STL container interface
virtual long add(ContainedObject *pObject)
Add an object to the container.
ObjectVector< TYPE >::reference back()
Return reference to the last element.
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
ObjectVector(const char *)
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
ObjectVector< TYPE >::reverse_iterator rbegin()
Return a reverse_iterator pointing to the beginning of the reversed container.
ObjectVector< TYPE >::const_iterator begin() const
Return a const_iterator pointing to the beginning of the container.
std::vector< TYPE * >::const_iterator const_iterator
std::vector< TYPE * > m_vector
The STL vector itself.
void push_back(typename ObjectVector< TYPE >::const_reference value)
push_back = append = insert a new element at the end of the container
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores...
void erase(typename ObjectVector< TYPE >::iterator first, typename ObjectVector< TYPE >::iterator last)
Erase the range [first, last) from the container. The removed object will be deleted.
std::vector< TYPE * >::const_reference const_reference
ObjectVector< TYPE >::const_reverse_iterator rend() const
Return a const_reverse_iterator pointing to the end of the reversed container.
std::vector< TYPE * >::const_pointer const_pointer
virtual ~ObjectVector()
Destructor.
virtual ObjectVector< TYPE >::size_type numberOfObjects() const
The same as size(), return number of objects in the container.
std::vector< TYPE * >::const_reverse_iterator const_reverse_iterator
ObjectVector< TYPE >::reference front()
Return reference to the first element.
ObjectVector< TYPE >::const_reference front() const
Return const_reference to the first element.
std::vector< TYPE * >::reverse_iterator reverse_iterator
virtual ContainedObject * containedObject(long dist) const
Return const pointer to an object of a given distance (index)
ObjectVector< TYPE >::reference operator[](typename ObjectVector< TYPE >::size_type n)
Return the reference to the n'th object in the container.
ObjectVector< TYPE >::size_type capacity() const
Return number of elements for which memory has been allocated It is always greater than or equal to s...
std::vector< TYPE * >::iterator iterator
bool empty() const
Return true if the size of the container is 0.
unsigned int CLID
Class ID definition.
void reserve(typename ObjectVector< TYPE >::size_type value)
Reserve place for "value" objects in the container.
ObjectVector< TYPE >::const_reverse_iterator rbegin() const
Return a const_reverse_iterator pointing to the beginning of the reversed container.
std::vector< TYPE * >::reference reference
ObjectVector< TYPE >::iterator insert(typename ObjectVector< TYPE >::iterator position, typename ObjectVector< TYPE >::const_reference value)
Insert "value" before "position".
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
ObjectVector< TYPE >::size_type max_size() const
Return the largest possible size of the container.
ObjectVector< TYPE >::const_reference back() const
Return const_reference to the last element.
ObjectVector()
Constructors.
std::vector< TYPE * >::value_type value_type
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
std::vector< TYPE * >::pointer pointer
virtual const CLID & clID() const
Retrieve class ID.
ObjectContainerBase is the base class for Gaudi container classes.
ObjectVector< TYPE >::reverse_iterator rend()
Return a reverse_iterator pointing to the end of the reversed container.
ObjectVector(const ObjectVector< TYPE > &value)
Copy constructor.
ObjectVector< TYPE >::size_type size() const
Return the size of the container.
ObjectVector< TYPE >::const_iterator end() const
Return a const_iterator pointing to the end of the container.
static const CLID & classID()
Retrieve class ID.
TO * reference(FROM *from)
void pop_back()
pop_back = remove the last element from the container The removed object will be deleted (see the met...