|
coastline 0.0.4
|
Doubly linked list of 16-bit words with pooled nodes and MFC position semantics. More...
#include <mfc.h>


Public Member Functions | |
| CWordList (int blockSize=10) | |
| Initialise an empty list with node allocation deferred until insertion. | |
| ~CWordList () override | |
| Release all nodes and pool blocks. | |
| BOOL | IsEmpty () const |
| int | GetCount () const |
| WORD & | GetHead () |
| POSITION | GetHeadPosition () const |
| WORD & | GetNext (POSITION &position) |
| Retrieve a node value and advance towards the tail. | |
| POSITION | AddHead (WORD value) |
| Insert a value at the head. | |
| POSITION | AddTail (WORD value) |
| Insert a value at the tail. | |
| POSITION | InsertBefore (POSITION position, WORD value) |
| Insert a value before a position, or at the head for a null position. | |
| POSITION | InsertAfter (POSITION position, WORD value) |
| Insert a value after a position, or at the tail for a null position. | |
| void | RemoveAt (POSITION position) |
| Remove a node and release all pool blocks when the list becomes empty. | |
| void | RemoveAll () |
| Remove every node and release all pool blocks. | |
| Public Member Functions inherited from CObject | |
| virtual CRuntimeClass * | GetRuntimeClass () const |
| virtual | ~CObject () |
| The base destructor does not perform additional cleanup. | |
| virtual void | Serialize (CArchive &archive) |
| Do not serialise archive data. | |
| virtual void | AssertValid () const |
| Do not validate object state. | |
| virtual void | Dump (CDumpContext &context) const |
| Do not emit diagnostic output. | |
Doubly linked list of 16-bit words with pooled nodes and MFC position semantics.
Positions and references remain valid until their nodes are removed or all storage is released.
|
explicit |
Initialise an empty list with node allocation deferred until insertion.
| blockSize | The positive number of nodes allocated per pool block. |
|
override |
Release all nodes and pool blocks.
| BOOL CWordList::IsEmpty | ( | ) | const |
| int CWordList::GetCount | ( | ) | const |
| WORD & CWordList::GetHead | ( | ) |
| POSITION CWordList::GetHeadPosition | ( | ) | const |
Retrieve a node value and advance towards the tail.
| position | A non-null position from this list, replaced with the next position or null. |
Insert a value at the head.
| value | The word copied into the new node. |
Insert a value at the tail.
| value | The word copied into the new node. |
Insert a value before a position, or at the head for a null position.
| position | A position from this list, or null. |
| value | The word copied into the new node. |
Insert a value after a position, or at the tail for a null position.
| position | A position from this list, or null. |
| value | The word copied into the new node. |
| void CWordList::RemoveAt | ( | POSITION | position | ) |
Remove a node and release all pool blocks when the list becomes empty.
| position | A non-null position identifying a current node in this list. |
| void CWordList::RemoveAll | ( | ) |
Remove every node and release all pool blocks.