Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_OBJECTLIST_H
12 #define GAUDIKERNEL_OBJECTLIST_H
81 static CLID clid = TYPE::classID() + CLID_ObjectList;
141 value->setParent(
this );
163 position->setParent(
nullptr );
175 if ( iter ==
end() ) {
183 ( *iter )->setParent(
nullptr );
191 value->setParent(
this );
197 if ( ( *position )->parent() ) {
200 ( *position )->setParent(
nullptr );
209 for (
auto iter = first; iter != last; ++iter ) {
212 ( *iter )->setParent(
nullptr );
240 s <<
"class ObjectList : size = " <<
std::setw( 12 ) <<
size() <<
"\n";
244 s <<
"\nContents of the STL list :";
246 for (
const auto& iter :
m_list ) {
247 s <<
"\nIndex " <<
std::setw( 12 ) << count++ <<
" of object of type " << *iter;
258 #endif // GAUDI_OBJECTLIST_H
ObjectList< TYPE >::const_reverse_iterator rend() const
Return a const_reverse_iterator pointing to the end of the reversed container.
long index(const ContainedObject *obj) const override
Return distance of a given object from the beginning of its container It corresponds to the "index" (...
ObjectList< TYPE >::reverse_iterator rbegin()
Return a reverse_iterator pointing to the beginning of the reversed container.
ObjectList()=default
Constructors.
~ObjectList() override
Destructor.
void push_back(typename ObjectList< TYPE >::const_reference value)
push_back = append = insert a new element at the end of the container
ObjectList< TYPE >::const_reference front() const
Return const_reference to the first element.
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.
ObjectList< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
void pop_back()
pop_back = remove the last element from the container The removed object will be deleted (see the met...
ObjectList(const ObjectList< TYPE > &)=delete
ObjectList< TYPE >::size_type max_size() const
Return the largest possible size of the container.
std::ostream & fillStream(std::ostream &s) const override
Fill the output stream (ASCII)
long remove(ContainedObject *value) override
Release object from the container (the pointer will be removed from the container,...
std::list< TYPE * >::reverse_iterator reverse_iterator
std::list< TYPE * > m_list
The STL list.
ObjectList< TYPE >::iterator insert(typename ObjectList< TYPE >::iterator position, typename ObjectList< TYPE >::const_reference value)
Insert "value" before "position".
void erase(typename ObjectList< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
ObjectList & operator=(const ObjectList< TYPE > &)=delete
std::list< TYPE * >::reference reference
std::list< TYPE * >::const_iterator const_iterator
const CLID & clID() const override
Retrieve pointer to class definition structure.
ObjectList< TYPE >::reference front()
Return reference to the first element.
ObjectList< TYPE >::size_type numberOfObjects() const override
The same as size(), return number of objects in the container.
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.
const ContainedObject * containedObject(long dist) const override
Return const pointer to an object of a given distance.
unsigned int CLID
Class ID definition.
ObjectList< TYPE >::reference back()
Return reference to the last element.
ObjectList< TYPE >::const_iterator begin() const
Return a const_iterator pointing to the beginning of the container.
ContainedObject * containedObject(long dist) override
Return const pointer to an object of a given distance.
std::vector< TYPE * >::pointer pointer
long add(ContainedObject *pObject) override
Add an object to the container.
ObjectList< TYPE >::const_reverse_iterator rbegin() const
Return a const_reverse_iterator pointing to the beginning of the reversed container.
ObjectList< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
std::vector< TYPE * >::const_pointer const_pointer
std::list< TYPE * >::iterator iterator
static const CLID & classID()
std::list< TYPE * >::const_reference const_reference
std::list< TYPE * >::const_reverse_iterator const_reverse_iterator
ObjectList< TYPE >::const_iterator end() const
Return a const_iterator pointing to the end of the container.
std::list< TYPE * >::value_type value_type
ObjectList< TYPE >::size_type size() const
Return the size of the container Size means the number of objects stored in the container,...
bool empty() const
Return true if the size of the container is 0.