|
Experimental Code
Code Written To Experiment With Various Techniques And Otherwise Not Very Useful...
|
DoubleLinkedList which can be iterated via DoubleLinkedList::iterator. More...
#include <DoubleLinkedList.h>
Public Types | |
| typedef T | value_type |
| Convenience typedef of the type of values in this list. More... | |
| typedef Experiment::Iterator< value_type, DoubleLinkedList< value_type >, Node > | iterator |
| Convenience typedef of iterators of this list. More... | |
Public Member Functions | |
| ~DoubleLinkedList () | |
| Destroy a list. More... | |
| DoubleLinkedList () | |
| Create a new list. More... | |
| DoubleLinkedList (const DoubleLinkedList &rhs) | |
| Copy data from another list. More... | |
| void | clear () |
| Remove all data from this list. More... | |
| bool | isEmpty () const |
| iterator | begin () |
| iterator | end () |
| void | push_front (const value_type &value) |
| Insert value as the first item in this list and udpate iterators to remain at same position. More... | |
| void | push_back (const value_type &value) |
| Insert value as the last item in this list. More... | |
| void | addIterator (iterator *iter) |
| Record that iter has been created as an iterator of this list. More... | |
| void | removeIterator (iterator *iter) |
| Record that iter that is being destroyed as an iterator of this list. More... | |
| void | notifyItersSwapOccurred (Node *a, Node *b) const |
| Notify all iterators that a swap occurred of nodes a and b so that they can update themselves to keep the same position. More... | |
| void | notifyItersInsertedBefore (int count, Node *firstAfter) const |
| Notify all iterators that count Nodes were inserted before firstAfter. More... | |
| void | notifyItersRemovedBefore (int count, Node *firstAfter) const |
| Notify all iterators that count Nodes were removed before firstAfter. More... | |
DoubleLinkedList which can be iterated via DoubleLinkedList::iterator.
| T | the type of Data this DoubleLinkedList will hold |
Definition at line 36 of file DoubleLinkedList.h.
| typedef Experiment::Iterator<value_type, DoubleLinkedList<value_type>, Node> Experiment::DoubleLinkedList< T >::iterator |
Convenience typedef of iterators of this list.
Definition at line 48 of file DoubleLinkedList.h.
| typedef T Experiment::DoubleLinkedList< T >::value_type |
Convenience typedef of the type of values in this list.
Definition at line 45 of file DoubleLinkedList.h.
| Experiment::DoubleLinkedList< T >::~DoubleLinkedList |
Destroy a list.
Definition at line 31 of file DoubleLinkedList.cpp.
| Experiment::DoubleLinkedList< T >::DoubleLinkedList |
Create a new list.
Definition at line 46 of file DoubleLinkedList.cpp.
| Experiment::DoubleLinkedList< T >::DoubleLinkedList | ( | const DoubleLinkedList< T > & | rhs | ) |
Copy data from another list.
| rhs | to copy from |
Definition at line 62 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::addIterator | ( | iterator * | iter | ) |
Record that iter has been created as an iterator of this list.
| iter | to add |
Definition at line 154 of file DoubleLinkedList.cpp.
| DoubleLinkedList< T >::iterator Experiment::DoubleLinkedList< T >::begin |
Definition at line 110 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::clear |
Remove all data from this list.
Definition at line 84 of file DoubleLinkedList.cpp.
| DoubleLinkedList< T >::iterator Experiment::DoubleLinkedList< T >::end |
Definition at line 119 of file DoubleLinkedList.cpp.
| bool Experiment::DoubleLinkedList< T >::isEmpty |
Definition at line 101 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::notifyItersInsertedBefore | ( | int | count, |
| Node * | firstAfter | ||
| ) | const |
Notify all iterators that count Nodes were inserted before firstAfter.
Notifies each iterator that each node from firstAfter that has been moved count times.
| count | number of nodes added |
| firstAfter | first node after the added nodes to update from |
Definition at line 214 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::notifyItersRemovedBefore | ( | int | count, |
| Node * | firstAfter | ||
| ) | const |
Notify all iterators that count Nodes were removed before firstAfter.
Notifies each iterator that each node from firstAfter to move count times.
| count | number of nodes removed |
| firstAfter | first node after the removed nodes to update from |
Definition at line 234 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::notifyItersSwapOccurred | ( | Node * | a, |
| Node * | b | ||
| ) | const |
Notify all iterators that a swap occurred of nodes a and b so that they can update themselves to keep the same position.
Since only a and b are altered, we note this so all other iterators can disregard.
| a | that swapped position with b |
| b | that swapped position with a |
Definition at line 196 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::push_back | ( | const value_type & | value | ) |
Insert value as the last item in this list.
Definition at line 139 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::push_front | ( | const value_type & | value | ) |
Insert value as the first item in this list and udpate iterators to remain at same position.
| value | to insert at the start of the list |
Definition at line 129 of file DoubleLinkedList.cpp.
| void Experiment::DoubleLinkedList< T >::removeIterator | ( | iterator * | iter | ) |
Record that iter that is being destroyed as an iterator of this list.
| iter | to remove |
Definition at line 169 of file DoubleLinkedList.cpp.