Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator Class Reference

Iterator class for an short array list. More...

#include <omShortArrayList.h>

Public Member Functions

 Iterator (ShortArrayList &newList)
 Create a new ShortArrayList iterator from a reference to a list. More...
 
void operator++ ()
 Prefix increment operator. More...
 
void operator++ (int)
 Postfix increment operator. More...
 
 operator Bool () const
 Return whether or not the iterator is at the end of the list. More...
 
T & operator* ()
 Return a reference to the current iterator element. More...
 
T * operator-> ()
 Access the current iterator element. More...
 
void remove ()
 Remove the current element from the list. More...
 
void removeUnordered ()
 Remove the current element from the list. More...
 
void reset ()
 Reset the iterator to the beginning of the list. More...
 
SizeType getIndex ()
 Get the index of the next element to be iterated over. More...
 

Detailed Description

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
class om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator

Iterator class for an short array list.

The purpose of this class is to iterate through all or some of the elements in the short array list, making changes as necessary to the elements.

Constructor & Destructor Documentation

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::Iterator ( ShortArrayList newList)
inline

Create a new ShortArrayList iterator from a reference to a list.

Member Function Documentation

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
void om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::operator++ ( )
inline

Prefix increment operator.

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
void om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::operator++ ( int  )
inline

Postfix increment operator.

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::operator Bool ( ) const
inline

Return whether or not the iterator is at the end of the list.

If the iterator is at the end of the list, return FALSE. Otherwise, return TRUE, indicating that there are more elements to iterate over.

Returns
FALSE if at the end of list, otherwise TRUE.
template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
T& om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::operator* ( )
inline

Return a reference to the current iterator element.

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
T* om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::operator-> ( )
inline

Access the current iterator element.

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
void om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::remove ( )
inline

Remove the current element from the list.

This method calls the removeAtIndex() method of the iterated short array list, and therefore has an average time complexity of O(n/2) where n is the size of the short array list.

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
void om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::removeUnordered ( )
inline

Remove the current element from the list.

This method calls the removeAtIndexUnordered() method of the iterated short array list, and therefore has an average time complexity of O(1).

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
void om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::reset ( )
inline

Reset the iterator to the beginning of the list.

template<typename T, Size localCapacity = Size(4), typename SizeType = Size>
SizeType om::util::ShortArrayList< T, localCapacity, SizeType >::Iterator::getIndex ( )
inline

Get the index of the next element to be iterated over.


The documentation for this class was generated from the following file: