Inherits CFX_Object.
Classes | |
struct | CNode |
Bidirectional node in CFX_PtrList. More... | |
Public Member Functions | |
CFX_PtrList (int nBlockSize=10, IFX_Allocator *pAllocator=0) | |
Construct with block size and allocator. More... | |
~CFX_PtrList () | |
FX_POSITION | AddHead (void *newElement) |
Add a value to the head. More... | |
FX_POSITION | AddTail (void *newElement) |
Add a value to the tail. More... | |
FX_POSITION | Find (void *searchValue, FX_POSITION startAfter=0) const |
Find a value starting after specified position. More... | |
FX_POSITION | FindIndex (int index) const |
Find a value by index number. More... | |
void * | GetAt (FX_POSITION rPosition) const |
Get an value at specified position. More... | |
int | GetCount () const |
Get the number of nodes. More... | |
FX_POSITION | GetHeadPosition () const |
Get the header position. More... | |
void * | GetNext (FX_POSITION &rPosition) const |
Get the the current value and set the position to next node. More... | |
FX_POSITION | GetNextPosition (FX_POSITION pos) const |
Get the next position. More... | |
void * | GetPrev (FX_POSITION &rPosition) const |
Get the the current value and set the position to previous node. More... | |
FX_POSITION | GetPrevPosition (FX_POSITION pos) const |
Get the previous position. More... | |
FX_POSITION | GetTailPosition () const |
Get the tail position. More... | |
FX_POSITION | InsertAfter (FX_POSITION pos, void *newElement) |
Insert a value after specified position. More... | |
void | RemoveAll () |
Remove all nodes in the list. More... | |
void | RemoveAt (FX_POSITION pos) |
Remove a node at specified position. More... | |
void | SetAt (FX_POSITION pos, void *newElement) |
Change the value at specified position. More... | |
The class represents pointer list.
CFX_PtrList::CFX_PtrList | ( | int | nBlockSize = 10 , |
IFX_Allocator * | pAllocator = 0 |
||
) |
Construct with block size and allocator.
[in] | nBlockSize | The block size. Default value: 10. |
[in] | pAllocator | An allocator. Default value: NULL. |
CFX_PtrList::~CFX_PtrList | ( | ) |
The destructor.
FX_POSITION CFX_PtrList::AddHead | ( | void * | newElement | ) |
Add a value to the head.
[in] | newElement | The value to be added to head. |
FX_POSITION CFX_PtrList::AddTail | ( | void * | newElement | ) |
Add a value to the tail.
[in] | newElement | The value to be added to tail. |
FX_POSITION CFX_PtrList::Find | ( | void * | searchValue, |
FX_POSITION | startAfter = 0 |
||
) | const |
Find a value starting after specified position.
[in] | searchValue | The value to be searched. |
[in] | startAfter | The position to start after. |
FX_POSITION CFX_PtrList::FindIndex | ( | int | index | ) | const |
Find a value by index number.
[in] | index | The zero-based index number of the element. |
|
inline |
Get an value at specified position.
[in] | rPosition | The input position. |
|
inline |
Get the number of nodes.
|
inline |
Get the header position.
|
inline |
Get the the current value and set the position to next node.
[in,out] | rPosition | Input a position, and receive the next node position as result. |
|
inline |
Get the next position.
[in] | pos | The input position. |
|
inline |
Get the the current value and set the position to previous node.
[in,out] | rPosition | Input a position, and receive the previous node position as result. |
|
inline |
Get the previous position.
[in] | pos | The input position. |
|
inline |
Get the tail position.
FX_POSITION CFX_PtrList::InsertAfter | ( | FX_POSITION | pos, |
void * | newElement | ||
) |
Insert a value after specified position.
[in] | pos | Specify the position. |
[in] | newElement | The new value. |
void CFX_PtrList::RemoveAll | ( | ) |
Remove all nodes in the list.
void CFX_PtrList::RemoveAt | ( | FX_POSITION | pos | ) |
Remove a node at specified position.
[in] | pos | The position to remove. |
|
inline |
Change the value at specified position.
[in] | pos | The position to change. |
[in] | newElement | The new value. |