Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
|
Doubly linked list template. More...
#include <nirtcpp/core/engine/irrList.hpp>
Classes | |
class | ConstIterator |
List iterator for const access. More... | |
class | Iterator |
List iterator. More... | |
Public Types | |
using | value_type = T |
using | size_type = u32 |
Public Member Functions | |
list () | |
Default constructor for empty list. | |
list (const list< T > &other) | |
Copy constructor. | |
~list () | |
Destructor. | |
void | operator= (const list< T > &other) |
Assignment operator. | |
u32 | size () const |
Returns amount of elements in list. | |
u32 | getSize () const |
void | clear () |
Clears the list, deletes all elements in the list. | |
bool | empty () const |
Checks for empty list. | |
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. | |
Iterator | begin () |
Gets first node. | |
ConstIterator | begin () const |
Gets first node. | |
Iterator | end () |
Gets end node. | |
ConstIterator | end () const |
Gets end node. | |
Iterator | getLast () |
Gets last element. | |
ConstIterator | getLast () const |
Gets last element. | |
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. | |
Iterator | erase (Iterator &it) |
Erases an element. | |
void | swap (list< T > &other) |
Swap the content of this list container with the content of another list. | |
|
inline |
Gets first node.
|
inline |
Gets first node.
|
inline |
Clears the list, deletes all elements in the list.
All existing iterators of this list will be invalid.
|
inline |
Checks for empty list.
|
inline |
Gets end node.
|
inline |
Gets end node.
|
inline |
Gets last element.
|
inline |
Gets last element.
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. |
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. |
Adds an element at the end of the list.
element | Element to add to the list. |
Adds an element at the begin of the list.
element | Element to add to the list. |
|
inline |
Returns amount of elements in list.
Swap the content of this list container with the content of another list.
Afterward this object will contain the content of the other object and the other object will contain the content of this object. Iterators will afterward be valid for the swapped object.
other | Swap content with this object |