5#ifndef NIRT_LIST_HPP_INCLUDED
6#define NIRT_LIST_HPP_INCLUDED
8#include <nirtcpp/core/engine/nirt_types.hpp>
9#include <nirtcpp/core/engine/irrAllocator.hpp>
10#include <nirtcpp/core/engine/irrMath.hpp>
28 SKListNode(
const T&
e) : Next(0), Prev(0), Element(
e) {}
53 while (num-- && this->Current != 0) ++(*this);
57 while(num++ && this->Current != 0) --(*this);
100 while(num-- && this->Current != 0) ++(*this);
104 while(num++ && this->Current != 0) --(*this);
118 const T &
operator * () {
return Current->Element; }
129 friend class list<
T>;
134 : First(0), Last(0), Size(0) {}
188 SKListNode *
next = First->Next;
310 node->Next =
it.Current->Next;
312 if (
it.Current->Next)
313 it.Current->Next->Prev =
node;
319 if (
it.Current == Last)
334 node->Prev =
it.Current->Prev;
336 if (
it.Current->Prev)
337 it.Current->Prev->Next =
node;
343 if (
it.Current == First)
359 if(
it.Current == First)
361 First =
it.Current->Next;
365 it.Current->Prev->Next =
it.Current->Next;
368 if(
it.Current == Last)
370 Last =
it.Current->Prev;
374 it.Current->Next->Prev =
it.Current->Prev;
398 using value_type =
T;
399 using size_type =
u32;
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
void deallocate(T *ptr)
Deallocate memory for an array of objects.
Definition irrAllocator.hpp:39
T * allocate(size_t cnt)
Allocate memory for an array of objects.
Definition irrAllocator.hpp:33
void destruct(T *ptr)
Destruct an element.
Definition irrAllocator.hpp:51
void construct(T *ptr, const T &e)
Construct an element.
Definition irrAllocator.hpp:45
List iterator for const access.
Definition irrList.hpp:85
List iterator.
Definition irrList.hpp:40
Doubly linked list template.
Definition irrList.hpp:21
list(const list< T > &other)
Copy constructor.
Definition irrList.hpp:138
list()
Default constructor for empty list.
Definition irrList.hpp:133
void insert_before(const Iterator &it, const T &element)
Inserts an element before an element.
Definition irrList.hpp:329
ConstIterator end() const
Gets end node.
Definition irrList.hpp:278
ConstIterator begin() const
Gets first node.
Definition irrList.hpp:262
Iterator erase(Iterator &it)
Erases an element.
Definition irrList.hpp:351
Iterator end()
Gets end node.
Definition irrList.hpp:270
void clear()
Clears the list, deletes all elements in the list.
Definition irrList.hpp:184
Iterator getLast()
Gets last element.
Definition irrList.hpp:286
ConstIterator getLast() const
Gets last element.
Definition irrList.hpp:294
void push_back(const T &element)
Adds an element at the end of the list.
Definition irrList.hpp:210
void push_front(const T &element)
Adds an element at the begin of the list.
Definition irrList.hpp:231
Iterator begin()
Gets first node.
Definition irrList.hpp:254
bool empty() const
Checks for empty list.
Definition irrList.hpp:202
u32 size() const
Returns amount of elements in list.
Definition irrList.hpp:172
~list()
Destructor.
Definition irrList.hpp:145
void insert_after(const Iterator &it, const T &element)
Inserts an element after an element.
Definition irrList.hpp:305
void swap(list< T > &other)
Swap the content of this list container with the content of another list.
Definition irrList.hpp:390
void operator=(const list< T > &other)
Assignment operator.
Definition irrList.hpp:152
void swap(T1 &a, T2 &b)
swaps the content of the passed parameters
Definition irrMath.hpp:175
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64