CORGI
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
corgi::VectorPool< T >::IteratorTemplate< bool > Class Template Reference

An Iterator for the VectorPool. More...

#include <vector_pool.h>

Detailed Description

template<typename T>
template<bool>
class corgi::VectorPool< T >::IteratorTemplate< bool >

An Iterator for the VectorPool.

This has constant-time access, so it is a good choice for iterating over the active elements that the pool owns.

Template Parameters
is_constA bool that determines if the IteratorTemplate should be defined as const.

Public Member Functions

 IteratorTemplate (VectorPool< T > *container, size_t index)
 Constructor for an IteratorTemplate to a given VectorPool index. More...
 
 ~IteratorTemplate ()
 Destructor for an IteratorTemplate.
 
bool operator== (const IteratorTemplate &other) const
 The standard equality operator to compare two IteratorTemplates. More...
 
bool operator!= (const IteratorTemplate &other) const
 The standard inequality operator to compare two IteratorTemplates. More...
 
IteratorTemplateoperator++ ()
 The prefix increment operator to move the iterator forward in the list. More...
 
IteratorTemplate operator++ (int)
 The postfix increment operator to move the iterator forward in the list. More...
 
IteratorTemplateoperator-- ()
 The prefix decrement operator to move the iterator backward in the list. More...
 
IteratorTemplate operator-- (int)
 The postfix decrement operator to move the iterator backward in the list. More...
 
reference operator* ()
 The dereference operator. More...
 
pointer operator-> ()
 Member access on the iterator. More...
 
VectorPoolReference ToReference () const
 Converts the Iterator into a VectorPoolReference, which is the preferred way for holding onto references into the VectorPool. More...
 
size_t index () const
 Get the index into the VectorPool vector. More...
 

Friends

class VectorPool< T >
 

Constructor & Destructor Documentation

template<typename T>
template<bool >
corgi::VectorPool< T >::IteratorTemplate< bool >::IteratorTemplate ( VectorPool< T > *  container,
size_t  index 
)
inline

Constructor for an IteratorTemplate to a given VectorPool index.

Parameters
[in]containerThe VectorPool to point to.
[in]indexThe index into the VectorPool's underlying vector.

Member Function Documentation

template<typename T>
template<bool >
size_t corgi::VectorPool< T >::IteratorTemplate< bool >::index ( ) const
inline

Get the index into the VectorPool vector.

Returns
Returns a size_t that represents the underlying index into the VectorPool vector that the Iterator refers to.
template<typename T>
template<bool >
bool corgi::VectorPool< T >::IteratorTemplate< bool >::operator!= ( const IteratorTemplate< bool > &  other) const
inline

The standard inequality operator to compare two IteratorTemplates.

Parameters
[in]otherThe other IteratorTemplate to compare with to check for inequality.
Returns
Returns false if the IteratorTemplate references the same index into the same VectorPool. Otherwise, it returns true.
template<typename T>
template<bool >
reference corgi::VectorPool< T >::IteratorTemplate< bool >::operator* ( )
inline

The dereference operator.

Returns
Returns a reference to the VectorPool data referenced by the Iterator.
template<typename T>
template<bool >
IteratorTemplate& corgi::VectorPool< T >::IteratorTemplate< bool >::operator++ ( )
inline

The prefix increment operator to move the iterator forward in the list.

Returns
Returns a reference to the incremented iterator.
template<typename T>
template<bool >
IteratorTemplate corgi::VectorPool< T >::IteratorTemplate< bool >::operator++ ( int  )
inline

The postfix increment operator to move the iterator forward in the list.

Returns
Returns a reference to the original, unincremented iterator.
template<typename T>
template<bool >
IteratorTemplate& corgi::VectorPool< T >::IteratorTemplate< bool >::operator-- ( )
inline

The prefix decrement operator to move the iterator backward in the list.

Returns
Returns a reference to the decremented iterator.
template<typename T>
template<bool >
IteratorTemplate corgi::VectorPool< T >::IteratorTemplate< bool >::operator-- ( int  )
inline

The postfix decrement operator to move the iterator backward in the list.

Returns
Returns a reference to the original, undecremented iterator.
template<typename T>
template<bool >
pointer corgi::VectorPool< T >::IteratorTemplate< bool >::operator-> ( )
inline

Member access on the iterator.

Returns
Returns a pointer to the VectorPool data referenced by the Iterator.
template<typename T>
template<bool >
bool corgi::VectorPool< T >::IteratorTemplate< bool >::operator== ( const IteratorTemplate< bool > &  other) const
inline

The standard equality operator to compare two IteratorTemplates.

Parameters
[in]otherThe other IteratorTemplate to compare with to check for equality.
Returns
Returns true if the IteratorTemplate references the same index into the same VectorPool. Otherwise, it returns false.
template<typename T>
template<bool >
VectorPoolReference corgi::VectorPool< T >::IteratorTemplate< bool >::ToReference ( ) const
inline

Converts the Iterator into a VectorPoolReference, which is the preferred way for holding onto references into the VectorPool.

Returns
Returns a VectorPoolReference pointing to the VectorPool at the index that the Iterator referred to.

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