Inheritance diagram for XFcLinkedList< T >:
Public Types | |
typedef XFcLinkedListAbstractIterator< T > | iterator |
Abstract iterator type. | |
typedef XFcLinkedListForwardIterator< T > | forwardIterator |
Forward iterator type. | |
typedef XFcLinkedListReverseIterator< T > | reverseIterator |
Reverse iterator type. | |
typedef XFcLinkedListBidirectionalIterator< T > | bidirectionalIterator |
Bidirectional iterator type. | |
Public Member Functions | |
forwardIterator | forwardBegin () const |
Returns a forward iterator pointing to the beginning of list. | |
forwardIterator | forwardEnd () const |
Returns a forward iterator pointing to the end of list. | |
reverseIterator | reverseBegin () const |
Returns a reverse iterator pointing to the beginning of list. | |
reverseIterator | reverseEnd () const |
Returns a reverse iterator pointing to the end of list. | |
bidirectionalIterator | bidirectionalBegin () const |
Returns a bidirectional iterator pointing to the beginning of list. | |
bidirectionalIterator | bidirectionalEnd () const |
Returns a bidirectional iterator pointing to the end of list. | |
UINT32 | size () const |
Returns the amount of nodes in the list. | |
T | getFirst () const |
Returns the value of the first node. | |
T | getLast () const |
Returns the value of the last node. | |
INT | add (const UINT32 aIndex, const T aNewData) |
Adds a new node by index. | |
INT | addFirst (const T aNewData) |
Adds a new node to the beginning of list. | |
INT | addLast (const T aNewData) |
Adds a new node to the end of list. | |
INT | addBefore (const iterator &aIterator, const T aNewData) |
Adds a new node before the node pointed to by an iterator. | |
INT | addAfter (const iterator &aIterator, const T aNewData) |
Adds a new node after the node pointed to by an iterator. | |
INT | removeIndex (const UINT32 aIndex) |
Removes a node by index. | |
INT | remove (const T aData) |
Removes a node by value. | |
INT | remove (iterator &aIterator, const UINT aMethod=1) |
Removes a node pointed to by an iterator. | |
XFcLinkedList () | |
Creates an empty list. | |
XFcLinkedList (const UINT32 aPreAlloc) | |
Creates an empty list with a number of preallocated nodes. | |
~XFcLinkedList () | |
Destructor. | |
Protected Member Functions | |
void | preAlloc () |
Preallocates nodes to the empty nodes list. | |
void | putEmptyNode (XFcLinkedListNode< T > *aNode) |
Puts an empty node into the empty nodes list. | |
XFcLinkedListNode< T > * | getEmptyNode () |
Returns and removes the first node from the empty nodes list. | |
void | removeNode (XFcLinkedListNode< T > *aNode) |
Removes a node from the list. | |
Protected Attributes | |
UINT32 | mNodes |
Number of nodes in list. | |
UINT32 | mPreAlloc |
Number of preallocated nodes. | |
UINT32 | mEmptyNodes |
Number of empty preallocated nodes. | |
XFcLinkedListNode< T > * | mHead |
Pointer to the first node in list. | |
XFcLinkedListNode< T > * | mTail |
Pointer to the last node in list. | |
XFcLinkedListNode< T > * | mEmpty |
Pointer to the empty node list, used for faster allocation. |
Example:
// Create the list XFcLinkedList<UINT32> *list = new XFcLinkedList<UINT32>(); list->addLast(1); list->addLast(2); list->addLast(3); list->addLast(4); list->removeIndex(2); // The list now contains items {1, 2, 4} delete list;
|
Bidirectional iterator type.
|
|
Forward iterator type.
|
|
Abstract iterator type.
|
|
Reverse iterator type.
|
|
Creates an empty list.
|
|
Creates an empty list with a number of preallocated nodes.
|
|
Destructor.
|
|
Adds a new node by index. If the list is empty, the node will be added as the first node in the list.
|
|
Adds a new node after the node pointed to by an iterator. If the list is empty, the node will be added as the first node in the list. If the iterator is not valid, the operation fails.
|
|
Adds a new node before the node pointed to by an iterator. If the list is empty, the node will be added as the first node in the list. If the iterator is not valid, the operation fails.
|
|
Adds a new node to the beginning of list.
|
|
Adds a new node to the end of list. If the list is empty, the node will be added as the first node in the list.
|
|
Returns a bidirectional iterator pointing to the beginning of list.
|
|
Returns a bidirectional iterator pointing to the end of list.
|
|
Returns a forward iterator pointing to the beginning of list.
|
|
Returns a forward iterator pointing to the end of list.
|
|
Returns and removes the first node from the empty nodes list.
|
|
Returns the value of the first node.
|
|
Returns the value of the last node.
|
|
Preallocates nodes to the empty nodes list.
|
|
Puts an empty node into the empty nodes list.
|
|
Removes a node pointed to by an iterator.
|
|
Removes a node by value.
|
|
Removes a node by index. If the given index is smaller than 0, or bigger than the amount of nodes in the list, the node will not be removed.
|
|
Removes a node from the list.
|
|
Returns a reverse iterator pointing to the beginning of list.
|
|
Returns a reverse iterator pointing to the end of list.
|
|
Returns the amount of nodes in the list.
|
|
Pointer to the empty node list, used for faster allocation.
|
|
Number of empty preallocated nodes.
|
|
Pointer to the first node in list.
|
|
Number of nodes in list.
|
|
Number of preallocated nodes.
|
|
Pointer to the last node in list.
|
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |