#include <llist.h>
Public Member Functions | |
| LList () | |
| The default constructor. | |
| LList (const LList< T > &) | |
| The copy constructor. | |
| ~LList () | |
| The destructor. | |
| LList & | operator= (const LList< T > &) |
| The implicit copy operator. | |
| void | insert (const T &_newdata) |
| Adds data at the end of the list. | |
| void | insert_back (const T &_newdata) |
| Adds data at the end of the list. | |
| void | insert_front (const T &_newdata) |
| Adds data at the start of the list. | |
| void | insert_at (const T &_newdata, size_t _index) |
| Adds data at the specified index. | |
| T const & | get (size_t _index) const |
| Gets the data at the specified index. | |
| T * | getPointer (size_t _index) const |
| Gets the address of where the data at the specified index is stored. | |
| void | change (T const &_rec, size_t _index) |
| Modifies the node at the given index. | |
| void | remove (size_t _index) |
| Removes the node at the given index. | |
| void | removeDataAtEnd () |
| Removes the node at the end of the list. | |
| size_t | find (const T &_data) |
| Finds a node's index by searching for the given data. | |
| size_t | size () const |
| Indicates the size of the linked list. | |
| bool | valid (size_t _index) const |
| Determines whether a given index is within the bounds of the list. | |
| void | empty () |
| Deletes all nodes in the list, but does not free memory allocated by data. | |
| T & | operator[] (size_t _index) |
| Gets the data at the given index. | |
| T const & | operator[] (size_t _index) const |
| Gets the data at the given index. | |
| void | sort (CrissCross::Data::Sorter< T > *_sortMethod) |
| Sorts the array using the provided method. | |
| void | sort (CrissCross::Data::Sorter< T > &_sortMethod) |
| Sorts the array using the provided method. | |
| size_t | mem_usage () const |
| Returns the overhead caused by the data structure. | |
Protected Attributes | |
| LListNode< T > * | m_first |
| The first node. | |
| LListNode< T > * | m_last |
| The last node. | |
| LListNode< T > * | m_previous |
| The last accessed node. | |
| size_t | m_previousIndex |
| The last accessed index. | |
| size_t | m_numItems |
| The number of nodes in the list. | |
| void change | ( | T const & | _rec, | |
| size_t | _index | |||
| ) |
Modifies the node at the given index.
This does not delete the data at the node, just the node itself.
| _rec | The new value for the given index. | |
| _index | The index of the node to modify. |
| size_t find | ( | const T & | _data | ) |
Finds a node's index by searching for the given data.
| _data | The data to find. |
| T const& get | ( | size_t | _index | ) | const [inline] |
Gets the data at the specified index.
| _index | The index of the data to fetch. |
| T* getPointer | ( | size_t | _index | ) | const [inline] |
Gets the address of where the data at the specified index is stored.
| _index | The index of the node to find. |
| void insert | ( | const T & | _newdata | ) | [inline] |
Adds data at the end of the list.
| _newdata | The data to add to the list. |
| void insert_at | ( | const T & | _newdata, | |
| size_t | _index | |||
| ) |
Adds data at the specified index.
| _newdata | The data to add to the list. | |
| _index | The index where the node should be added. |
| void insert_back | ( | const T & | _newdata | ) |
Adds data at the end of the list.
| _newdata | The data to add to the list. |
| void insert_front | ( | const T & | _newdata | ) |
Adds data at the start of the list.
| _newdata | The data to add to the list. |
| size_t mem_usage | ( | ) | const |
Returns the overhead caused by the data structure.
| T const& operator[] | ( | size_t | _index | ) | const |
Gets the data at the given index.
| _index | The index of the node to get data from. |
| T& operator[] | ( | size_t | _index | ) |
Gets the data at the given index.
| _index | The index of the node to get data from. |
| void remove | ( | size_t | _index | ) |
Removes the node at the given index.
This does not delete the data at the node, just the node itself.
| _index | The index of the node to delete. |
| void removeDataAtEnd | ( | ) | [inline] |
Removes the node at the end of the list.
This does not delete the data at the node, just the node itself.
| size_t size | ( | ) | const [inline] |
Indicates the size of the linked list.
| void sort | ( | CrissCross::Data::Sorter< T > & | _sortMethod | ) |
Sorts the array using the provided method.
| _sortMethod | The method to sort with. |
| void sort | ( | CrissCross::Data::Sorter< T > * | _sortMethod | ) |
Sorts the array using the provided method.
| _sortMethod | The method to sort with. |
| bool valid | ( | size_t | _index | ) | const [inline] |
Determines whether a given index is within the bounds of the list.
| _index | The index to validate. |
LListNode<T>* m_previous [mutable, protected] |
The last accessed node.
Speeds up searches and sequential access.
size_t m_previousIndex [mutable, protected] |
The last accessed index.
Speeds up searches and sequential access.
1.5.8