Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_OBJECTVECTOR_H
12 #define GAUDIKERNEL_OBJECTVECTOR_H
82 i->setParent(
nullptr );
91 static const CLID clid = TYPE::classID() + CLID_ObjectVector;
163 value->setParent(
this );
185 position->setParent(
nullptr );
204 ( *i )->setParent(
nullptr );
212 value->setParent(
this );
218 if ( ( *position )->parent() ) {
221 ( *position )->setParent(
nullptr );
230 for (
auto i = first; i != last; i++ ) {
233 ( *i )->setParent(
nullptr );
265 s <<
"class ObjectVector : size = " <<
std::setw( 12 ) <<
size() <<
"\n";
269 s <<
"\nContents of the STL vector :";
271 for (
const auto& i :
m_vector ) {
s <<
"\nIndex " <<
std::setw( 12 ) << count++ <<
" of object of type " << *i; }
281 #endif // GAUDIKERNEL_OBJECTVECTOR_H
ObjectVector< TYPE >::size_type max_size() const
Return the largest possible size of the container.
std::vector< TYPE * >::const_iterator const_iterator
ObjectVector< TYPE >::const_reverse_iterator rend() const
Return a const_reverse_iterator pointing to the end of the reversed container.
ObjectVector & operator=(const ObjectVector< TYPE > &)=delete
const CLID & clID() const override
Retrieve class ID.
ObjectVector< TYPE >::reference front()
Return reference to the first element.
std::vector< TYPE * >::iterator iterator
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< TYPE >::const_iterator begin() const
Return a const_iterator pointing to the beginning of the container.
ContainedObject * containedObject(long dist) override
std::vector< TYPE * >::value_type value_type
void pop_back()
pop_back = remove the last element from the container The removed object will be deleted (see the met...
ObjectVector< TYPE >::size_type size() const
Return the size of the container.
ObjectVector< TYPE >::const_reference front() const
Return const_reference to the first element.
ObjectVector(const ObjectVector< TYPE > &)=delete
ObjectVector(ObjectVector &&rhs)
void push_back(typename ObjectVector< TYPE >::const_reference value)
push_back = append = insert a new element at the end of the container
void reserve(typename ObjectVector< TYPE >::size_type value)
Reserve place for "value" objects in the container.
std::vector< TYPE * >::reference reference
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of 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 >::const_iterator end() const
Return a const_iterator pointing to the end of the container.
std::vector< TYPE * >::const_pointer const_pointer
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 >::iterator insert(typename ObjectVector< TYPE >::iterator position, typename ObjectVector< TYPE >::const_reference value)
Insert "value" before "position".
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.
ObjectVector< TYPE >::reverse_iterator rbegin()
Return a reverse_iterator pointing to the beginning of the reversed container.
std::vector< TYPE * >::const_reference const_reference
ObjectVector< TYPE >::reference back()
Return reference to the last element.
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
unsigned int CLID
Class ID definition.
std::vector< TYPE * >::pointer pointer
ObjectVector< TYPE >::const_reverse_iterator rbegin() const
Return a const_reverse_iterator pointing to the beginning of the reversed container.
std::vector< TYPE * >::const_reverse_iterator const_reverse_iterator
ObjectVector< TYPE >::size_type numberOfObjects() const override
The same as size(), return number of objects in the container.
ObjectVector< TYPE >::const_reference back() const
Return const_reference to the last element.
~ObjectVector() override
Destructor.
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
long remove(ContainedObject *value) override
Release object from the container (the poiter will be removed from the container, but the object itse...
bool empty() const
Return true if the size of the container is 0.
std::ostream & fillStream(std::ostream &s) const override
Fill the output stream (ASCII)
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.
ContainedObject const * containedObject(long dist) const override
Return const pointer to an object of a given distance (index)
std::vector< TYPE * > m_vector
The STL vector itself.
ObjectVector< TYPE >::reverse_iterator rend()
Return a reverse_iterator pointing to the end of the reversed container.
long add(ContainedObject *pObject) override
Add an object to the container.
ObjectVector()=default
Constructors.
static const CLID & classID()
Retrieve class ID.
void clear()
Clear the entire content of the container and delete all contained objects.