|
MoSync 3.2.1
|
A generic, dynamic list container. More...
#include <MAUtil/List.h>
Classes | |
| class | ConstListIterator |
| A constant iterator for a list container. More... | |
| class | ListIterator |
| An iterator for a list container. More... | |
| class | ListNode |
| A node in a list container. More... | |
Public Member Functions | |
| List () | |
| Constructs an empty list. | |
| void | addFirst (const Type &data) |
| void | addLast (const Type &data) |
| ListIterator | insert (ListIterator iterator, const Type &data) |
| ListIterator | remove (ListIterator iterator) |
| ListIterator | begin () |
| ListIterator | end () |
| ConstListIterator | begin () const |
| ConstListIterator | end () const |
| int | size () const |
Friends | |
| class | ListIterator |
| class | ConstListIterator |
A generic, dynamic list container.
You can retrieve either a ListIterator or ConstListIterator to iterate through the list.
| MAUtil::List< Type >::List | ( | ) | [inline] |
Constructs an empty list.
| void MAUtil::List< Type >::addFirst | ( | const Type & | data | ) | [inline] |
Adds an element to the beginning of the list.
References MAUtil::List< Type >::ListNode::mPrev, and NULL.
| void MAUtil::List< Type >::addLast | ( | const Type & | data | ) | [inline] |
Adds an element to the end of the list.
References MAUtil::List< Type >::ListNode::mNext, and NULL.
| ListIterator MAUtil::List< Type >::insert | ( | ListIterator | iterator, |
| const Type & | data | ||
| ) | [inline] |
Inserts an element at a specific position in the list.
| iterator | An iterator pointing to the element after which the element is to be added. The iterator is invalidated by this operation. |
| data | The element to be inserted. |
References MAUtil::List< Type >::ListNode::mNext, MAUtil::List< Type >::ListNode::mPrev, and NULL.
| ListIterator MAUtil::List< Type >::remove | ( | ListIterator | iterator | ) | [inline] |
Removes an element from list.
| iterator | An iterator pointing to the element to be removed. The iterator is invalidated by this operation. |
References MAUtil::List< Type >::ListIterator, MAUtil::List< Type >::ListNode::mNext, MAUtil::List< Type >::ListNode::mPrev, and NULL.
| ListIterator MAUtil::List< Type >::begin | ( | ) | [inline] |
Returns an iterator pointing to the first element in the list.
References MAUtil::List< Type >::ListIterator.
| ListIterator MAUtil::List< Type >::end | ( | ) | [inline] |
Returns an iterator pointing beyond the last element of the list.
References MAUtil::List< Type >::ListIterator.
| ConstListIterator MAUtil::List< Type >::begin | ( | ) | const [inline] |
References MAUtil::List< Type >::ConstListIterator.
| ConstListIterator MAUtil::List< Type >::end | ( | ) | const [inline] |
References MAUtil::List< Type >::ConstListIterator.
| int MAUtil::List< Type >::size | ( | ) | const [inline] |
Returns the number of elements in the list.
friend class ListIterator [friend] |
Referenced by MAUtil::List< Type >::begin(), MAUtil::List< Type >::end(), and MAUtil::List< Type >::remove().
friend class ConstListIterator [friend] |
Referenced by MAUtil::List< Type >::begin(), and MAUtil::List< Type >::end().