NL3D::CFastPtrListBase Class Reference

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 >.

List of all members.

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
CFastPtrListBaseoperator= (const CFastPtrListBase &)

Private Attributes

std::vector< void * > _Elements
std::vector< CFastPtrListNode * > _Nodes

Detailed Description

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.

Author:
Lionel Berenguier
Nevrax France
Date:
2002

Definition at line 78 of file fast_ptr_list.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

void** NL3D::CFastPtrListBase::begin (  )  [inline]
void NL3D::CFastPtrListBase::clear (  ) 
bool NL3D::CFastPtrListBase::empty (  )  const [inline]
void NL3D::CFastPtrListBase::erase ( CFastPtrListNode node  ) 
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]

Member Data Documentation

std::vector<void*> NL3D::CFastPtrListBase::_Elements [private]

Definition at line 106 of file fast_ptr_list.h.

Referenced by begin(), empty(), erase(), insert(), and size().

Definition at line 107 of file fast_ptr_list.h.

Referenced by clear(), erase(), and insert().


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

Generated on Thu Jan 7 08:30:04 2010 for NeL by  doxygen 1.6.1