1 #ifndef GAUDIKERNEL_OBJECTLIST_H 2 #define GAUDIKERNEL_OBJECTLIST_H 73 static CLID clid = TYPE::classID() + CLID_ObjectList;
134 if ( value->parent() ) {
137 value->setParent(
this );
162 position->setParent(
nullptr );
175 if ( iter ==
end() ) {
183 ( *iter )->setParent(
nullptr );
192 value->setParent(
this );
199 if ( ( *position )->parent() ) {
202 ( *position )->setParent(
nullptr );
212 for (
auto iter = first; iter != last; ++iter ) {
215 ( *iter )->setParent(
nullptr );
242 s <<
"class ObjectList : size = " <<
std::setw( 12 ) <<
size() <<
"\n";
246 s <<
"\nContents of the STL list :";
248 for (
const auto& iter :
m_list ) {
249 s <<
"\nIndex " <<
std::setw( 12 ) << count++ <<
" of object of type " << *iter;
260 #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.
size_t size_type
size_type, to conform the STL container interface
ObjectList< TYPE >::size_type numberOfObjects() const override
The same as size(), return number of objects in the container.
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 & operator=(const ObjectList< TYPE > &)=delete
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.
ContainedObject * containedObject(long dist) const override
Return const pointer to an object of a given distance.
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
const CLID & clID() const override
Retrieve pointer to class definition structure.
std::list< TYPE * >::reference reference
~ObjectList() override
Destructor.
std::list< TYPE * >::value_type value_type
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.
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.
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()=default
Constructors.
ObjectList< TYPE >::reference front()
Return reference to the first element.
std::ostream & fillStream(std::ostream &s) const override
Fill the output stream (ASCII)
ObjectList< TYPE >::size_type max_size() const
Return the largest possible size of the container.
std::list< TYPE * >::const_reverse_iterator const_reverse_iterator
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.
long index(const ContainedObject *obj) const override
Return distance of a given object from the beginning of its container It corresponds to the "index" (...
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
long add(ContainedObject *pObject) override
Add an object to 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.
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.