NL3D::CFastPtrList< T > Class Template Reference

#include <fast_ptr_list.h>

Inheritance diagram for NL3D::CFastPtrList< T >:

NL3D::CFastPtrListBase

Detailed Description

template<class T>
class NL3D::CFastPtrList< T >

Type Safe version of CFastPtrListBase
Author:
Lionel Berenguier

Nevrax France

Date:
2002

Definition at line 120 of file fast_ptr_list.h.

Public Member Functions

T ** begin ()
 Get the head on the array of elements. NULL if none.

 CFastPtrList ()
 Constructor.

void clear ()
 clear the list

bool empty () const
void erase (CFastPtrListNode *node)
 erase an element in the list through its Node, unlinking older if necessary

void insert (void *element, CFastPtrListNode *node)
 insert an element in the list through its Node, unlinking older if necessary

void insert (T *element, CFastPtrListNode *node)
 insert an element in the list through its Node, unlinking older if necessary

uint size () const
 get the number of elements

 ~CFastPtrList ()


Constructor & Destructor Documentation

template<class T>
NL3D::CFastPtrList< T >::CFastPtrList  )  [inline]
 

Constructor.

Definition at line 124 of file fast_ptr_list.h.

00124 {}

template<class T>
NL3D::CFastPtrList< T >::~CFastPtrList  )  [inline]
 

Definition at line 125 of file fast_ptr_list.h.

00125 {}


Member Function Documentation

template<class T>
T** NL3D::CFastPtrList< T >::begin  )  [inline]
 

Get the head on the array of elements. NULL if none.

Reimplemented from NL3D::CFastPtrListBase.

Definition at line 133 of file fast_ptr_list.h.

Referenced by NL3D::CQuadGridClipManager::traverseClip().

00133 {return (T**)CFastPtrListBase::begin();}

template<class T>
void NL3D::CFastPtrList< T >::clear  )  [inline]
 

clear the list

Reimplemented from NL3D::CFastPtrListBase.

Definition at line 139 of file fast_ptr_list.h.

00139 {CFastPtrListBase::clear();}

template<class T>
bool NL3D::CFastPtrList< T >::empty  )  const [inline]
 

Reimplemented from NL3D::CFastPtrListBase.

Definition at line 136 of file fast_ptr_list.h.

00136 {return CFastPtrListBase::empty();}

template<class T>
void NL3D::CFastPtrList< T >::erase CFastPtrListNode node  )  [inline]
 

erase an element in the list through its Node, unlinking older if necessary

Reimplemented from NL3D::CFastPtrListBase.

Definition at line 130 of file fast_ptr_list.h.

00130 {CFastPtrListBase::erase(node);}

void NL3D::CFastPtrListBase::insert void *  element,
CFastPtrListNode node
[inherited]
 

insert an element in the list through its Node, unlinking older if necessary

Definition at line 67 of file fast_ptr_list.cpp.

References NL3D::CFastPtrListBase::_Elements, NL3D::CFastPtrListNode::_IndexInOwner, NL3D::CFastPtrListBase::_Nodes, NL3D::CFastPtrListNode::_Owner, nlassert, and NL3D::CFastPtrListNode::unlink().

00068 {
00069         nlassert(element);
00070         nlassert(node);
00071 
00072         // if this node is already linked to me, no-op!
00073         if(node->_Owner==this)
00074                 return;
00075 
00076         // first unlink the node from its older list if any.
00077         node->unlink();
00078 
00079         // then add the elements to the list, and update node info
00080         _Elements.push_back(element);
00081         _Nodes.push_back(node);
00082         node->_Owner= this;
00083         node->_IndexInOwner= _Nodes.size()-1;
00084 }

template<class T>
void NL3D::CFastPtrList< T >::insert T *  element,
CFastPtrListNode node
[inline]
 

insert an element in the list through its Node, unlinking older if necessary

Definition at line 128 of file fast_ptr_list.h.

Referenced by NL3D::CQuadGridClipManager::linkModel().

00128 {CFastPtrListBase::insert(element, node);}

template<class T>
uint NL3D::CFastPtrList< T >::size  )  const [inline]
 

get the number of elements

Reimplemented from NL3D::CFastPtrListBase.

Definition at line 135 of file fast_ptr_list.h.

Referenced by NL3D::CQuadGridClipManager::traverseClip().

00135 {return CFastPtrListBase::size();}


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 06:46:32 2004 for NeL by doxygen 1.3.6