John Bailey / FixedLengthList

Dependents:   FixedLengthListTest XBeeApi

Embed: (wiki syntax)

« Back to documentation index

FixedLengthListIter< T, queueMax > Class Template Reference

FixedLengthListIter< T, queueMax > Class Template Reference

Iterator support class for FixedLengthList. More...

#include <FixedLengthList.hpp>

Public Member Functions

 FixedLengthListIter (void)
 Void constructor - iterator will be equal to T::end()
 FixedLengthListIter (FixedLengthListItem< T > *p_item)
 Construct an iterator which points to a list item within a FixedLengthList.
T & operator* ()
 De-reference operator, yields the value of the list item.
bool operator!= (const FixedLengthListIter &p_comp) const
 Inequality operator.
bool operator== (const FixedLengthListIter &p_comp) const
 Equality operator.
FixedLengthListIteroperator+= (const unsigned p_inc)
 Move the iterator forward a specified number of list elements.
FixedLengthListIter operator++ (int p_int)
 Post-increment operator.
FixedLengthListIteroperator++ (void)
 Pre-increment operator.

Protected Attributes

FixedLengthListItem< T > * m_item
 The iterator hooks into the used list within the FixedLengthList.

Detailed Description

template<class T, size_t queueMax>
class FixedLengthListIter< T, queueMax >

Iterator support class for FixedLengthList.

Example:

          #define LIST_LEN (20U)
          FixedLengthList<int,  LIST_LEN > list;

          int main( void ) {
             // List is empty

             list.queue( 111 );
             list.queue( 222 );

             FixedLengthList<int, LIST_LEN>::iterator it = list.begin();
             *it == 111;
             it++;
             *it == 222;
             it++;
             *it == list.end();
          }

Definition at line 75 of file FixedLengthList.hpp.


Constructor & Destructor Documentation

FixedLengthListIter ( void   )

Void constructor - iterator will be equal to T::end()

Definition at line 625 of file FixedLengthList.hpp.

FixedLengthListIter ( FixedLengthListItem< T > *  p_item )

Construct an iterator which points to a list item within a FixedLengthList.

Definition at line 630 of file FixedLengthList.hpp.


Member Function Documentation

bool operator!= ( const FixedLengthListIter< T, queueMax > &  p_comp ) const

Inequality operator.

Definition at line 677 of file FixedLengthList.hpp.

T & operator* (  )

De-reference operator, yields the value of the list item.

Definition at line 635 of file FixedLengthList.hpp.

FixedLengthListIter< T, queueMax > operator++ ( int  p_int )

Post-increment operator.

Definition at line 641 of file FixedLengthList.hpp.

FixedLengthListIter< T, queueMax > & operator++ ( void   )

Pre-increment operator.

Definition at line 649 of file FixedLengthList.hpp.

FixedLengthListIter< T, queueMax > & operator+= ( const unsigned  p_inc )

Move the iterator forward a specified number of list elements.

Parameters:
p_incNumber of items to traverse

Definition at line 656 of file FixedLengthList.hpp.

bool operator== ( const FixedLengthListIter< T, queueMax > &  p_comp ) const

Equality operator.

Definition at line 671 of file FixedLengthList.hpp.


Field Documentation

FixedLengthListItem<T>* m_item [protected]

The iterator hooks into the used list within the FixedLengthList.

Definition at line 79 of file FixedLengthList.hpp.