Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::core::list< T > Class Template Reference

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.
 

Detailed Description

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

Doubly linked list template.

Member Function Documentation

◆ begin() [1/2]

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

Gets first node.

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

◆ begin() [2/2]

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

Gets first node.

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

◆ clear()

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

Clears the list, deletes all elements in the list.

All existing iterators of this list will be invalid.

◆ empty()

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

Checks for empty list.

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

◆ end() [1/2]

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

Gets end node.

Returns
List iterator pointing to null.

◆ end() [2/2]

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

Gets end node.

Returns
Const list iterator pointing to null.

◆ erase()

template<class T >
Iterator nirt::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.

◆ getLast() [1/2]

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

Gets last element.

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

◆ getLast() [2/2]

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

Gets last element.

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

◆ insert_after()

template<class T >
void nirt::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.

◆ insert_before()

template<class T >
void nirt::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.

◆ push_back()

template<class T >
void nirt::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.

◆ push_front()

template<class T >
void nirt::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.

◆ size()

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

Returns amount of elements in list.

Returns
Amount of elements in the list.

◆ swap()

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

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.

Parameters
otherSwap content with this object

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

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print