This class store actually an array of void*, for very fast acces (list is slower because of RAM access). More...
#include <fast_ptr_list.h>
Inherited by NL3D::CFastPtrList< CPointLightModel >, NL3D::CFastPtrList< CQuadGridClipCluster >, NL3D::CFastPtrList< CTransform >, NL3D::CFastPtrList< CTransformShape >, and NL3D::CFastPtrList< T >.
Public Member Functions | |
| CFastPtrListBase () | |
| Constructor. | |
| CFastPtrListBase (const CFastPtrListBase &) | |
| ~CFastPtrListBase () | |
| void | insert (void *element, CFastPtrListNode *node) |
| insert an element in the list through its Node, unlinking older if necessary | |
| void | erase (CFastPtrListNode *node) |
| erase an element in the list through its Node. No-op if the list does not have this element | |
| void ** | begin () |
| Get the head on the array of elements. NULL if none. | |
| uint | size () const |
| get the number of elements | |
| bool | empty () const |
| void | clear () |
| clear the list | |
| CFastPtrListBase & | operator= (const CFastPtrListBase &) |
Private Attributes | |
| std::vector< void * > | _Elements |
| std::vector< CFastPtrListNode * > | _Nodes |
This class store actually an array of void*, for very fast acces (list is slower because of RAM access).
CFastPtrListBase advantages are the insert() and erase() are in O(1) Overhead Cost is 8 bytes per node + 4 bytes in the _Nodes array.
Definition at line 78 of file fast_ptr_list.h.
| NL3D::CFastPtrListBase::CFastPtrListBase | ( | ) | [inline] |
Constructor.
Definition at line 82 of file fast_ptr_list.h.
| NL3D::CFastPtrListBase::CFastPtrListBase | ( | const CFastPtrListBase & | ) | [inline] |
Definition at line 83 of file fast_ptr_list.h.
| NL3D::CFastPtrListBase::~CFastPtrListBase | ( | ) |
Definition at line 47 of file fast_ptr_list.cpp.
References clear().
| void** NL3D::CFastPtrListBase::begin | ( | ) | [inline] |
Get the head on the array of elements. NULL if none.
Reimplemented in NL3D::CFastPtrList< T >, NL3D::CFastPtrList< CTransformShape >, NL3D::CFastPtrList< CQuadGridClipCluster >, NL3D::CFastPtrList< CPointLightModel >, and NL3D::CFastPtrList< CTransform >.
Definition at line 92 of file fast_ptr_list.h.
References _Elements.
| void NL3D::CFastPtrListBase::clear | ( | ) |
clear the list
Reimplemented in NL3D::CFastPtrList< T >, NL3D::CFastPtrList< CTransformShape >, NL3D::CFastPtrList< CQuadGridClipCluster >, NL3D::CFastPtrList< CPointLightModel >, and NL3D::CFastPtrList< CTransform >.
Definition at line 54 of file fast_ptr_list.cpp.
References _Nodes, erase(), and size().
Referenced by ~CFastPtrListBase().
| bool NL3D::CFastPtrListBase::empty | ( | ) | const [inline] |
Reimplemented in NL3D::CFastPtrList< T >, NL3D::CFastPtrList< CTransformShape >, NL3D::CFastPtrList< CQuadGridClipCluster >, NL3D::CFastPtrList< CPointLightModel >, and NL3D::CFastPtrList< CTransform >.
Definition at line 95 of file fast_ptr_list.h.
References _Elements.
| void NL3D::CFastPtrListBase::erase | ( | CFastPtrListNode * | node | ) |
erase an element in the list through its Node. No-op if the list does not have this element
Reimplemented in NL3D::CFastPtrList< T >, NL3D::CFastPtrList< CTransformShape >, NL3D::CFastPtrList< CQuadGridClipCluster >, NL3D::CFastPtrList< CPointLightModel >, and NL3D::CFastPtrList< CTransform >.
Definition at line 85 of file fast_ptr_list.cpp.
References _Elements, NL3D::CFastPtrListNode::_IndexInOwner, _Nodes, and NL3D::CFastPtrListNode::_Owner.
Referenced by clear(), and NL3D::CFastPtrListNode::unlink().
| void NL3D::CFastPtrListBase::insert | ( | void * | element, | |
| CFastPtrListNode * | node | |||
| ) |
insert an element in the list through its Node, unlinking older if necessary
Definition at line 65 of file fast_ptr_list.cpp.
References _Elements, NL3D::CFastPtrListNode::_IndexInOwner, _Nodes, NL3D::CFastPtrListNode::_Owner, nlassert, and NL3D::CFastPtrListNode::unlink().
| CFastPtrListBase& NL3D::CFastPtrListBase::operator= | ( | const CFastPtrListBase & | ) | [inline] |
Definition at line 101 of file fast_ptr_list.h.
| uint NL3D::CFastPtrListBase::size | ( | ) | const [inline] |
get the number of elements
Reimplemented in NL3D::CFastPtrList< T >, NL3D::CFastPtrList< CTransformShape >, NL3D::CFastPtrList< CQuadGridClipCluster >, NL3D::CFastPtrList< CPointLightModel >, and NL3D::CFastPtrList< CTransform >.
Definition at line 94 of file fast_ptr_list.h.
References _Elements.
Referenced by clear().
std::vector<void*> NL3D::CFastPtrListBase::_Elements [private] |
std::vector<CFastPtrListNode*> NL3D::CFastPtrListBase::_Nodes [private] |
Definition at line 107 of file fast_ptr_list.h.
1.6.1