#include <RmLinkedList.h>
Public Member Functions | |
| RmLinkedList () | |
| Constructor. | |
| RmLinkedList (const RmLinkedList< Type > &src) | |
| Copy Constructor. | |
| ~RmLinkedList () | |
| int | size () const |
| Get number of items. | |
| bool | empty () const |
| Check for empty. | |
| ItemNode * | GetHead () |
| Get first itemnode. | |
| const ItemNode * | GetHead () const |
| Get first itemnode. | |
| ItemNode * | GetTail () |
| Get tail of list. | |
| const ItemNode * | GetTail () const |
| Get tail of list. | |
| bool | clear () |
| Clear everything. | |
| Type & | front () |
| Get first item. | |
| const Type & | front () const |
| Get first item. | |
| Type & | back () |
| Get last item in list. | |
| const Type & | back () const |
| Get last item in list. | |
| bool | push_back (Type data) |
| Add new item to end. | |
| bool | push_front (Type data) |
| Add new item to front of list. | |
| bool | pop_front () |
| Pop front item. | |
| bool | pop_back () |
| Pop last item. | |
| bool | remove (Type data) |
| Remove item. | |
| bool | insert (iterator &where, Type data) |
| Insert item. | |
| void | swap (iterator &itr1, iterator &itr2) |
| Swap items. | |
| iterator | erase (iterator &itr) |
| Remove item by iterator. | |
| iterator | begin () |
| Begin iterator. | |
| const_iterator | begin () const |
| Begin iterator. | |
| iterator | end () |
| End iterator. | |
| const_iterator | end () const |
| End iterator. | |
| Type & | operator[] (int nIndex) |
| Access item by index. | |
| const Type & | operator[] (int nIndex) const |
| Access item by index. | |
| void | operator= (const RmLinkedList< Type > &src) |
| Copy list. | |
| iterator | find (Type item) |
| Find item. | |
| const_iterator | find (Type item) const |
| Find item. | |
RmLinkedList provides a templated linked list class, eliminating the need for an external STL implementation. All standard linked list access, iterator, and modifier functions are available through this implementation.
To define the class:
RmLinkedList< TYPE > myLinkedList
To define an iterator to use with the class:
RmLinkedList< TYPE >::iterator myLinkedListIterator;
|
|||||||||
|
Constructor. Constructor |
|
||||||||||
|
Copy Constructor. Copy Constructor
|
|
|||||||||
|
Destructor Destructor |
|
|||||||||
|
Get last item in list. Returns the last item in the list
|
|
|||||||||
|
Get last item in list. Returns the last item in the list
|
|
|||||||||
|
Begin iterator. Returns an iterator initializes to the beginning of the array
|
|
|||||||||
|
Begin iterator. Returns an iterator initializes to the beginning of the array
|
|
|||||||||
|
Clear everything. Clears out all items in the list
|
|
|||||||||
|
Check for empty. Returns true if the list is empty, false otherwise
|
|
|||||||||
|
End iterator. Returns an iterator initializes to the beginning of the array
|
|
|||||||||
|
End iterator. Returns an iterator initializes to the beginning of the array
|
|
||||||||||
|
Remove item by iterator. Removes the item pointed to by the iterator itr from the array
|
|
||||||||||
|
Find item. Find Function
|
|
||||||||||
|
Find item. Find Function
|
|
|||||||||
|
Get first item. Returns the first item in the list
|
|
|||||||||
|
Get first item. Returns the first item in the list
|
|
|||||||||
|
Get first itemnode. Returns the head of the list
|
|
|||||||||
|
Get first itemnode. Returns the head of the list
|
|
|||||||||
|
Get tail of list. Returns the tail of the list
|
|
|||||||||
|
Get tail of list. Returns the tail of the list
|
|
||||||||||||||||
|
Insert item. Inserts an item at a specific location
|
|
||||||||||
|
Copy list. Copy Operator
|
|
||||||||||
|
Access item by index. Returns the array item at index
|
|
||||||||||
|
Access item by index. Returns the array item at index
|
|
|||||||||
|
Pop last item. Pops the last item and remove it from list
|
|
|||||||||
|
Pop front item. Pops the first item and remove it from list
|
|
||||||||||
|
Add new item to end. Pushes a new item to the back of the list
|
|
||||||||||
|
Add new item to front of list. Pushes a new item to the front of the list
|
|
||||||||||
|
Remove item. Removes a specific item
|
|
|||||||||
|
Get number of items. Returns the number if items in the list
|
|
||||||||||||||||
|
Swap items. Swaps two items
|
1.3.6