Irrlicht 3D Engine
irr::core::list< T > Class Template Reference

Doubly linked list template. More...

#include <irrList.h>

Classes

class  ConstIterator
 List iterator for const access. More...
 
class  Iterator
 List iterator. More...
 

Public Member Functions

 list ()
 Default constructor for empty list. More...
 
 list (const list< T > &other)
 Copy constructor. More...
 
 ~list ()
 Destructor. More...
 
Iterator begin ()
 Gets first node. More...
 
ConstIterator begin () const
 Gets first node. More...
 
void clear ()
 Clears the list, deletes all elements in the list. More...
 
bool empty () const
 Checks for empty list. More...
 
Iterator end ()
 Gets end node. More...
 
ConstIterator end () const
 Gets end node. More...
 
Iterator erase (Iterator &it)
 Erases an element. More...
 
Iterator getLast ()
 Gets last element. More...
 
ConstIterator getLast () const
 Gets last element. More...
 
u32 getSize () const
 
void insert_after (const Iterator &it, const T &element)
 Inserts an element after an element. More...
 
void insert_before (const Iterator &it, const T &element)
 Inserts an element before an element. More...
 
void operator= (const list< T > &other)
 Assignment operator. More...
 
void push_back (const T &element)
 Adds an element at the end of the list. More...
 
void push_front (const T &element)
 Adds an element at the begin of the list. More...
 
u32 size () const
 Returns amount of elements in list. More...
 
void swap (list< T > &other)
 Swap the content of this list container with the content of another list. More...
 

Detailed Description

template<class T>
class irr::core::list< T >

Doubly linked list template.

Definition at line 20 of file irrList.h.

Constructor & Destructor Documentation

§ list() [1/2]

template<class T>
irr::core::list< T >::list ( )
inline

Default constructor for empty list.

Definition at line 136 of file irrList.h.

§ list() [2/2]

template<class T>
irr::core::list< T >::list ( const list< T > &  other)
inline

Copy constructor.

Definition at line 141 of file irrList.h.

§ ~list()

template<class T>
irr::core::list< T >::~list ( )
inline

Destructor.

Definition at line 148 of file irrList.h.

Member Function Documentation

§ begin() [1/2]

template<class T>
Iterator irr::core::list< T >::begin ( )
inline

Gets first node.

Returns
A list iterator pointing to the beginning of the list.

Definition at line 257 of file irrList.h.

Referenced by irr::core::list< T >::Iterator::operator->(), and irr::core::list< T >::ConstIterator::operator=().

§ begin() [2/2]

template<class T>
ConstIterator irr::core::list< T >::begin ( ) const
inline

Gets first node.

Returns
A const list iterator pointing to the beginning of the list.

Definition at line 265 of file irrList.h.

§ clear()

template<class T>
void irr::core::list< T >::clear ( )
inline

Clears the list, deletes all elements in the list.

All existing iterators of this list will be invalid.

Definition at line 187 of file irrList.h.

Referenced by irr::core::list< irr::scene::ISceneNodeAnimator *>::operator=(), and irr::core::list< irr::scene::ISceneNodeAnimator *>::~list().

§ empty()

template<class T>
bool irr::core::list< T >::empty ( ) const
inline

Checks for empty list.

Returns
True if the list is empty and false if not.

Definition at line 205 of file irrList.h.

§ end() [1/2]

template<class T>
Iterator irr::core::list< T >::end ( )
inline

Gets end node.

Returns
List iterator pointing to null.

Definition at line 273 of file irrList.h.

§ end() [2/2]

template<class T>
ConstIterator irr::core::list< T >::end ( ) const
inline

Gets end node.

Returns
Const list iterator pointing to null.

Definition at line 281 of file irrList.h.

§ erase()

template<class T>
Iterator irr::core::list< T >::erase ( Iterator it)
inline

Erases an element.

Parameters
itIterator pointing to the element which shall be erased.
Returns
Iterator pointing to next element.

Definition at line 354 of file irrList.h.

§ getLast() [1/2]

template<class T>
Iterator irr::core::list< T >::getLast ( )
inline

Gets last element.

Returns
List iterator pointing to the last element of the list.

Definition at line 289 of file irrList.h.

§ getLast() [2/2]

template<class T>
ConstIterator irr::core::list< T >::getLast ( ) const
inline

Gets last element.

Returns
Const list iterator pointing to the last element of the list.

Definition at line 297 of file irrList.h.

§ getSize()

template<class T>
u32 irr::core::list< T >::getSize ( ) const
inline

Definition at line 179 of file irrList.h.

§ insert_after()

template<class T>
void irr::core::list< T >::insert_after ( const Iterator it,
const T &  element 
)
inline

Inserts an element after an element.

Parameters
itIterator pointing to element after which the new element should be inserted.
elementThe new element to be inserted into the list.

Definition at line 308 of file irrList.h.

§ insert_before()

template<class T>
void irr::core::list< T >::insert_before ( const Iterator it,
const T &  element 
)
inline

Inserts an element before an element.

Parameters
itIterator pointing to element before which the new element should be inserted.
elementThe new element to be inserted into the list.

Definition at line 332 of file irrList.h.

§ operator=()

template<class T>
void irr::core::list< T >::operator= ( const list< T > &  other)
inline

Assignment operator.

Definition at line 155 of file irrList.h.

§ push_back()

template<class T>
void irr::core::list< T >::push_back ( const T &  element)
inline

Adds an element at the end of the list.

Parameters
elementElement to add to the list.

Definition at line 213 of file irrList.h.

Referenced by irr::core::list< irr::scene::ISceneNodeAnimator *>::operator=().

§ push_front()

template<class T>
void irr::core::list< T >::push_front ( const T &  element)
inline

Adds an element at the begin of the list.

Parameters
elementElement to add to the list.

Definition at line 234 of file irrList.h.

§ size()

template<class T>
u32 irr::core::list< T >::size ( ) const
inline

Returns amount of elements in list.

Returns
Amount of elements in the list.

Definition at line 175 of file irrList.h.

§ swap()

template<class T>
void irr::core::list< T >::swap ( list< T > &  other)
inline

Swap the content of this list container with the content of another list.

Afterwards this object will contain the content of the other object and the other object will contain the content of this object. Iterators will afterwards be valid for the swapped object.

Parameters
otherSwap content with this object

Definition at line 393 of file irrList.h.


The documentation for this class was generated from the following file: