Go to the documentation of this file.
46 typedef typename std::list<TYPE*>::value_type
value_type;
51 typedef typename std::list<TYPE*>::iterator
iterator;
57 typedef typename std::vector<TYPE*>::pointer
pointer;
70 static CLID clid = TYPE::classID() + CLID_ObjectList;
130 value->setParent(
this );
131 m_list.push_back( value );
149 auto position =
m_list.back();
152 position->setParent(
nullptr );
164 if ( iter ==
end() ) {
172 ( *iter )->setParent(
nullptr );
180 value->setParent(
this );
181 return m_list.insert( position, value );
186 if ( ( *position )->parent() ) {
189 ( *position )->setParent(
nullptr );
198 for (
auto iter = first; iter != last; ++iter ) {
201 ( *iter )->setParent(
nullptr );
205 m_list.erase( first, last );
215 return i !=
end() ? std::distance(
begin(), i ) : -1;
220 return dist <
size() ? *std::next(
begin(), dist ) :
nullptr;
224 return dist <
size() ? *std::next(
begin(), dist ) :
nullptr;
229 s <<
"class ObjectList : size = " << std::setw( 12 ) <<
size() <<
"\n";
233 s <<
"\nContents of the STL list :";
235 for (
const auto& iter :
m_list ) {
236 s <<
"\nIndex " << std::setw( 12 ) << count++ <<
" of object of type " << *iter;
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.
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
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
Generator[dict, None, None] reference(request, Optional[Path] reference_path)
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.