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. | |
list (const list< T > &other) | |
Copy constructor. | |
~list () | |
Destructor. | |
Iterator | begin () |
Gets first node. | |
ConstIterator | begin () const |
Gets first node. | |
void | clear () |
Clears the list, deletes all elements in the list. | |
bool | empty () const |
Checks for empty list. | |
Iterator | end () |
Gets end node. | |
ConstIterator | end () const |
Gets end node. | |
Iterator | erase (Iterator &it) |
Erases an element. | |
Iterator | getLast () |
Gets last element. | |
ConstIterator | getLast () const |
Gets last element. | |
u32 | getSize () const |
void | insert_after (const Iterator &it, const T &element) |
Inserts an element after an element. | |
void | insert_before (const Iterator &it, const T &element) |
Inserts an element before an element. | |
void | operator= (const list< T > &other) |
Assignment operator. | |
void | push_back (const T &element) |
Adds an element at the end of the list. | |
void | push_front (const T &element) |
Adds an element at the begin of the list. | |
u32 | size () const |
Returns amount of elements in list. | |
void | swap (list< T > &other) |
Swap the content of this list container with the content of another list. | |
Doubly linked list template.
|
inline |
|
inline |
|
inline |
|
inline |
|
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.
References irr::core::irrAllocator< T >::deallocate(), and irr::core::irrAllocator< T >::destruct().
Referenced by irr::core::list< T >::~list(), and irr::core::list< T >::operator=().
|
inline |
|
inline |
|
inline |
Erases an element.
it | Iterator pointing to the element which shall be erased. |
Definition at line 354 of file irrList.h.
References irr::core::irrAllocator< T >::deallocate(), and irr::core::irrAllocator< T >::destruct().
|
inline |
|
inline |
|
inline |
Inserts an element after an element.
it | Iterator pointing to element after which the new element should be inserted. |
element | The new element to be inserted into the list. |
Definition at line 308 of file irrList.h.
References irr::core::irrAllocator< T >::allocate(), and irr::core::irrAllocator< T >::construct().
Inserts an element before an element.
it | Iterator pointing to element before which the new element should be inserted. |
element | The new element to be inserted into the list. |
Definition at line 332 of file irrList.h.
References irr::core::irrAllocator< T >::allocate(), and irr::core::irrAllocator< T >::construct().
Assignment operator.
Definition at line 155 of file irrList.h.
References irr::core::list< T >::clear(), and irr::core::list< T >::push_back().
Adds an element at the end of the list.
element | Element to add to the list. |
Definition at line 213 of file irrList.h.
References irr::core::irrAllocator< T >::allocate(), and irr::core::irrAllocator< T >::construct().
Referenced by irr::core::list< T >::operator=().
Adds an element at the begin of the list.
element | Element to add to the list. |
Definition at line 234 of file irrList.h.
References irr::core::irrAllocator< T >::allocate(), and irr::core::irrAllocator< T >::construct().
|
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.
other | Swap content with this object |
Definition at line 393 of file irrList.h.
References irr::core::swap().