1 #ifndef GAUDIKERNEL_OBJECTVECTOR_H 2 #define GAUDIKERNEL_OBJECTVECTOR_H 75 i->setParent(
nullptr );
85 static const CLID clid = TYPE::classID() + CLID_ObjectVector;
157 if ( value->parent() ) {
160 value->setParent(
this );
185 position->setParent(
nullptr );
205 ( *i )->setParent(
nullptr );
214 value->setParent(
this );
221 if ( ( *position )->parent() ) {
224 ( *position )->setParent(
nullptr );
234 for (
auto i = first; i != last; i++ ) {
237 ( *i )->setParent(
nullptr );
271 s <<
"class ObjectVector : size = " <<
std::setw( 12 ) <<
size() <<
"\n";
275 s <<
"\nContents of the STL vector :";
278 s <<
"\nIndex " <<
std::setw( 12 ) << count++ <<
" of object of type " << *i;
289 #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.
long add(ContainedObject *pObject) override
Add an object to the container.
size_t size_type
size_type, to conform the STL container interface
const CLID & clID() const override
Retrieve class ID.
ObjectVector< TYPE >::reference back()
Return reference to the last element.
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
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_reference operator[](typename ObjectVector< TYPE >::size_type n) const
Return the const_reference to the n'th object in the 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...
ContainedObject * containedObject(long dist) const override
Return const pointer to an object of a given distance (index)
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
ObjectVector(ObjectVector &&rhs)
std::vector< TYPE * >::const_reverse_iterator const_reverse_iterator
ObjectVector< TYPE >::reference front()
Return reference to the first element.
ObjectVector & operator=(const ObjectVector< TYPE > &)=delete
ObjectVector< TYPE >::const_reference front() const
Return const_reference to the first element.
std::vector< TYPE * >::reverse_iterator reverse_iterator
ObjectVector< TYPE >::reference operator[](typename ObjectVector< TYPE >::size_type n)
Return the reference to the n'th object in the container.
long index(const ContainedObject *obj) const override
Return distance of a given object from the beginning of its container It correcponds to the "index" (...
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...
ObjectVector()=default
Constructors.
std::vector< TYPE * >::iterator iterator
bool empty() const
Return true if the size of the container is 0.
~ObjectVector() override
Destructor.
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.
std::ostream & fillStream(std::ostream &s) const override
Fill the output stream (ASCII)
std::vector< TYPE * >::value_type value_type
ObjectVector< TYPE >::size_type numberOfObjects() const override
The same as size(), return number of objects in the container.
std::vector< TYPE * >::pointer pointer
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< 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.
void pop_back()
pop_back = remove the last element from the container The removed object will be deleted (see the met...