#include <ordering_table.h>
Nevrax France
Definition at line 43 of file ordering_table.h.
Public Member Functions | |
| void | begin () |
| COrderingTable () | |
| T * | get () |
| uint32 | getSize () |
| void | init (uint32 nNbEntries) |
| void | insert (uint32 nEntryPos, T *pValue) |
| void | next () |
| void | reset (uint maxElementToInsert) |
| ~COrderingTable () | |
Private Attributes | |
| std::vector< CNode > | _Allocator |
| CNode * | _Array |
| CNode * | _CurAllocatedNode |
| uint32 | _nNbElt |
| CNode * | _SelNode |
|
|||||||||
|
Definition at line 130 of file ordering_table.h. References NL3D::COrderingTable< T >::_Array, NL3D::COrderingTable< T >::_CurAllocatedNode, NL3D::COrderingTable< T >::_nNbElt, and NL3D::COrderingTable< T >::_SelNode.
00131 {
00132 _nNbElt = 0;
00133 _Array = NULL;
00134 _SelNode = NULL;
00135 _CurAllocatedNode= NULL;
00136 }
|
|
|||||||||
|
Definition at line 139 of file ordering_table.h. References NL3D::COrderingTable< T >::_Array.
|
|
|||||||||
|
Traversing operations OrderingTable<Face> ot; ot.begin(); while( ot.get() != NULL ) { Face *pF = ot.get(); // Do the treatment you want here ot.next(); } Definition at line 205 of file ordering_table.h. References NL3D::COrderingTable< T >::_Array, NL3D::COrderingTable< T >::_SelNode, NL3D::COrderingTable< T >::next(), and NL3D::COrderingTable< T >::CNode::val.
|
|
|||||||||
|
Get the currently selected element. Definition at line 213 of file ordering_table.h. References NL3D::COrderingTable< T >::_SelNode, and NL3D::COrderingTable< T >::CNode::val.
|
|
|||||||||
|
Just return the number of entries in the ordering table Definition at line 159 of file ordering_table.h. References NL3D::COrderingTable< T >::_nNbElt, and uint32.
00160 {
00161 return _nNbElt;
00162 }
|
|
||||||||||
|
Initialization. The ordering table has a range from 0 to nNbEntries-1 Definition at line 146 of file ordering_table.h. References NL3D::COrderingTable< T >::_Array, NL3D::COrderingTable< T >::_nNbElt, NL3D::COrderingTable< T >::reset(), and uint32.
|
|
||||||||||||||||
|
Insert an element in the ordering table NB: element is inserted in front of the list at nEntryPos (for optim consideration) NB: nlassert in debug if num of insert() calls exceed value passed in reset() NB: nlassert in debug if nEntryPos is => getSize() Definition at line 183 of file ordering_table.h. References NL3D::COrderingTable< T >::_Allocator, NL3D::COrderingTable< T >::_Array, NL3D::COrderingTable< T >::_CurAllocatedNode, NL3D::COrderingTable< T >::_nNbElt, NL3D::COrderingTable< T >::CNode::next, nlassert, uint32, and NL3D::COrderingTable< T >::CNode::val.
00184 {
00185 #ifdef NL_DEBUG
00186 // check not so many calls to insert()
00187 nlassert( !_Allocator.empty() && _CurAllocatedNode < (&_Allocator[0])+_Allocator.size() );
00188 // check good entry size
00189 nlassert( nEntryPos < _nNbElt );
00190 #endif
00191 // get the head list node
00192 CNode *headNode = &_Array[nEntryPos];
00193 // alocate a new node
00194 CNode *nextNode = _CurAllocatedNode++;
00195 // fill this new node with data of head node
00196 nextNode->val= headNode->val;
00197 nextNode->next= headNode->next;
00198 // and replace head node with new data: consequence is pValue is insert in front of the list
00199 headNode->val= pValue;
00200 headNode->next= nextNode;
00201 // NB: prec of headNode is still correclty linked to headNode.
00202 }
|
|
|||||||||
|
Move selection pointer to the next element Definition at line 222 of file ordering_table.h. References NL3D::COrderingTable< T >::_SelNode, NL3D::COrderingTable< T >::CNode::next, and NL3D::COrderingTable< T >::CNode::val. Referenced by NL3D::COrderingTable< T >::begin().
|
|
||||||||||
|
Put the ordering table to empty
Definition at line 165 of file ordering_table.h. References NL3D::COrderingTable< T >::_Allocator, NL3D::COrderingTable< T >::_Array, NL3D::COrderingTable< T >::_CurAllocatedNode, NL3D::COrderingTable< T >::_nNbElt, NL3D::COrderingTable< T >::CNode::next, uint, uint32, and NL3D::COrderingTable< T >::CNode::val. Referenced by NL3D::COrderingTable< T >::init().
00166 {
00167 // reset allocation
00168 maxElementToInsert= max(1U, maxElementToInsert);
00169 _Allocator.resize(maxElementToInsert);
00170 _CurAllocatedNode= &_Allocator[0];
00171
00172 // reset OT.
00173 for( uint32 i = 0; i < _nNbElt-1; ++i )
00174 {
00175 _Array[i].val = NULL;
00176 _Array[i].next = &_Array[i+1];
00177 }
00178 _Array[_nNbElt-1].val = NULL;
00179 _Array[_nNbElt-1].next = NULL;
00180 }
|
|
|||||
|
Definition at line 120 of file ordering_table.h. Referenced by NL3D::COrderingTable< T >::insert(), and NL3D::COrderingTable< T >::reset(). |
|
|||||
|
|||||
|
Definition at line 121 of file ordering_table.h. Referenced by NL3D::COrderingTable< T >::COrderingTable(), NL3D::COrderingTable< T >::insert(), and NL3D::COrderingTable< T >::reset(). |
|
|||||
|
Definition at line 123 of file ordering_table.h. Referenced by NL3D::COrderingTable< T >::COrderingTable(), NL3D::COrderingTable< T >::getSize(), NL3D::COrderingTable< T >::init(), NL3D::COrderingTable< T >::insert(), and NL3D::COrderingTable< T >::reset(). |
|
|||||
|
Definition at line 125 of file ordering_table.h. Referenced by NL3D::COrderingTable< T >::begin(), NL3D::COrderingTable< T >::COrderingTable(), NL3D::COrderingTable< T >::get(), and NL3D::COrderingTable< T >::next(). |
1.3.6