#include <sharedpoollist.h>
SharedPoolList represents an ordered list of elements of a single type, drawn as needed from a pre-allocated pool that you provide.
T | The type of object to be stored in this list. |
In order to use this class, you must create an instance of SharedPoolList::Pool.
You must then set the SharedPoolList to use this pool of objects, either in its constructor or by calling SharedPoolList::SetNodePool().
For example:
To iterate through the elements of the list in ascending order:
Public typedefs | |
typedef SPListNode< T > | Node |
typedef SPL_Iterator< T > | Iterator |
typedef SPL_ConstIterator< T > | ConstIterator |
typedef Pool< SPListNode< T > > | NodePool |
typedef NodePool::Key | NodeKey |
Main API Functions | |
SharedPoolList (NodePool *nodePool=0) | |
void | SetNodePool (NodePool *nodePool) |
~SharedPoolList () | |
void | Clear () |
KyUInt32 | GetCount () const |
Bounds | |
ConstIterator | GetFirst () const |
ConstIterator | GetLast () const |
Iterator | GetFirst () |
Iterator | GetLast () |
ConstIterator | Begin () const |
ConstIterator | End () const |
Iterator | Begin () |
Iterator | End () |
Utility Functions | |
bool | IsEmpty () const |
bool | IsFirst (ConstIterator it) const |
bool | IsFirst (Iterator it) const |
bool | IsLast (ConstIterator it) const |
bool | IsLast (Iterator it) const |
bool | IsNull (ConstIterator it) const |
bool | IsNull (Iterator it) const |
bool | IsValid (ConstIterator it) const |
bool | IsValid (Iterator it) const |
ConstIterator | Find (const T &data) const |
Iterator | Find (const T &data) |
Node Insertion | |
Iterator | InsertBefore (const T &data, Iterator nextNodeIt) |
Iterator | InsertAfter (Iterator prevNodeIt, const T &data) |
Iterator | InsertBefore (Iterator nextNodeIt) |
Iterator | InsertAfter (Iterator prevNodeIt) |
Iterator | PushFront (const T &data) |
Iterator | PushBack (const T &data) |
Iterator | PushFront () |
Iterator | PushBack () |
Node Removal | |
Iterator | Erase (Iterator it) |
Iterator | RemoveFirstOccurrence (Iterator begin, const T &data) |
KyUInt32 | RemoveAllOccurrences (const T &data) |
template<class Predicate > | |
KyUInt32 | Remove_If (Predicate predicate) |