Single linked list template definition. More...
#include <tlist.h>

Data Structures | |
| struct | TLink |
Public Member Functions | |
| TLinkedList () | |
| TLinkedList (const TLinkedList< T > &) | |
| List copy constructor. | |
| TLinkedList (const TContainer< T > &) | |
| Construct from container. | |
| ~TLinkedList () | |
| List destructor. | |
| TContainer< T > * | newInstance () const |
| TLinkedList< T > & | operator= (const TLinkedList< T > &) |
| Assignment operator. | |
| virtual bool | add (const T &) |
| bool | append (const T &) |
| Same as TLinkedList::add. | |
| bool | prepend (const T &) |
| Add item to beginning of the list. | |
| bool | insertAt (int32 index, const T &) |
| Insert item at the specified index. | |
| bool | replaceAt (int32 index, const T &) |
| Replace item at the specified index. | |
| virtual bool | remove (const T &) |
| virtual bool | remove (const TIterator< T > &) |
| virtual bool | removeAt (int32) |
| virtual void | removeAll () |
| T | removeFirst () |
| Remove first item and return copy of the removed item. | |
| T | removeLast () |
| Remove last item and return copy of the removed item. | |
| bool | insertAfter (const T &after, const T &data) |
| Search for the first item equal to the specified item in the list and inserts the second item immediately after. | |
| bool | insertBefore (const T &before, const T &data) |
| Search for the first item equal to the specified item in the list and inserts the second item immediately before. | |
| T & | first () const |
| Get first item in list. | |
| T & | last () const |
| Get last item in list. | |
| int32 | index (const T &item) const |
| Get index of equal item. | |
| virtual T & | at (int32 index) const |
| virtual T & | lookup (const T &item) const |
| virtual bool | contains (const T &item) const |
| virtual int32 | occurrences (const T &item) const |
| virtual TIterator< T > * | newIterator () const |
Single linked list template definition.
| TLinkedList | ( | ) | [inline] |
| TLinkedList | ( | const TLinkedList< T > & | l | ) | [inline] |
List copy constructor.
| TLinkedList | ( | const TContainer< T > & | cont | ) | [inline] |
Construct from container.
| ~TLinkedList | ( | ) | [inline] |
List destructor.
| TContainer< T > * newInstance | ( | ) | const [inline, virtual] |
Create a copy of this container.
Implements TContainer< T >.
| TLinkedList< T > & operator= | ( | const TLinkedList< T > & | l | ) | [inline] |
Assignment operator.
Reimplemented in TDeque< T >, TQueue< T >, and TStack< T >.
| bool add | ( | const T & | rObj | ) | [inline, virtual] |
Create a copy of this container.
Implements TContainer< T >.
| bool append | ( | const T & | obj | ) | [inline] |
Same as TLinkedList::add.
| bool prepend | ( | const T & | obj | ) | [inline] |
Add item to beginning of the list.
| bool insertAt | ( | int32 | index, | |
| const T & | rObj | |||
| ) | [inline] |
Insert item at the specified index.
| bool replaceAt | ( | int32 | index, | |
| const T & | rObj | |||
| ) | [inline] |
Replace item at the specified index.
| bool remove | ( | const T & | rObj | ) | [inline, virtual] |
Remove equal item.
Implements TContainer< T >.
| bool remove | ( | const TIterator< T > & | iter | ) | [inline, virtual] |
Remove item at current iterator position.
Implements TContainer< T >.
| bool removeAt | ( | int32 | idx | ) | [inline, virtual] |
Remove item at given index.
Implements TContainer< T >.
| void removeAll | ( | ) | [inline, virtual] |
Remove all items from list.
Implements TContainer< T >.
| T removeFirst | ( | ) | [inline] |
Remove first item and return copy of the removed item.
| T removeLast | ( | ) | [inline] |
Remove last item and return copy of the removed item.
| bool insertAfter | ( | const T & | after, | |
| const T & | data | |||
| ) | [inline] |
Search for the first item equal to the specified item in the list and inserts the second item immediately after.
| bool insertBefore | ( | const T & | before, | |
| const T & | data | |||
| ) | [inline] |
Search for the first item equal to the specified item in the list and inserts the second item immediately before.
| T & first | ( | ) | const [inline] |
Get first item in list.
| T & last | ( | ) | const [inline] |
Get last item in list.
| int32 index | ( | const T & | item | ) | const [inline] |
Get index of equal item.
| T & at | ( | int32 | index | ) | const [inline, virtual] |
Get item at index.
Reimplemented from TContainer< T >.
| T & lookup | ( | const T & | item | ) | const [inline, virtual] |
Searches for the item equal to the specified item in the list and returns the first occurrence.
Reimplemented from TContainer< T >.
| bool contains | ( | const T & | item | ) | const [inline, virtual] |
See if container has equal item.
Reimplemented from TContainer< T >.
| int32 occurrences | ( | const T & | item | ) | const [inline, virtual] |
Count occurrences of equal items.
Reimplemented from TContainer< T >.
| TIterator< T > * newIterator | ( | ) | const [inline, virtual] |
Create container iterator instance.
Implements TContainer< T >.