MADARA  3.4.1
madara::utility::LStackIterator< T > Class Template Reference

Implements a forward iterator for LStack type classes. More...

#include <LStack.h>

Public Types

typedef int difference_type
 
typedef ::std::forward_iterator_tag iterator_category
 
typedef T * pointer
 
typedef T & reference
 
typedef T value_type
 

Public Member Functions

 LStackIterator (LStack< T > &stack, LStackNode< T > *pos=0)
 Construct an LStackIterator at node pos. More...
 
 LStackIterator (LStack< T > &stack, size_t pos=0)
 Construct an LStackIterator at position pos. More...
 
bool operator!= (const LStackIterator< T > &lhs) const
 Nonequality operator. More...
 
T & operator* (void)
 Dereference operator returns a reference to the item contained at the current position. More...
 
const T & operator* (void) const
 Returns a const reference to the item contained at the current position. More...
 
LStackIterator< T > operator++ (int)
 Postincrement operator. More...
 
LStackIterator< T > & operator++ (void)
 Preincrement operator. More...
 
bool operator== (const LStackIterator< T > &rhs) const
 Equality operator. More...
 

Private Attributes

LStackNode< T > * pos_
 
LStack< T > & stack_
 the stack we are dealing with More...
 

Detailed Description

template<typename T>
class madara::utility::LStackIterator< T >

Implements a forward iterator for LStack type classes.

Note: Having a const ExpressionTreeIterator does not guarantee that the current position that it points to will not change, it only guarantees that you cannot change the underlying stack!

Definition at line 148 of file LStack.h.

Member Typedef Documentation

◆ difference_type

template<typename T >
typedef int madara::utility::LStackIterator< T >::difference_type

Definition at line 181 of file LStack.h.

◆ iterator_category

template<typename T >
typedef ::std::forward_iterator_tag madara::utility::LStackIterator< T >::iterator_category

Definition at line 177 of file LStack.h.

◆ pointer

template<typename T >
typedef T* madara::utility::LStackIterator< T >::pointer

Definition at line 179 of file LStack.h.

◆ reference

template<typename T >
typedef T& madara::utility::LStackIterator< T >::reference

Definition at line 180 of file LStack.h.

◆ value_type

template<typename T >
typedef T madara::utility::LStackIterator< T >::value_type

Definition at line 178 of file LStack.h.

Constructor & Destructor Documentation

◆ LStackIterator() [1/2]

template<typename T >
madara::utility::LStackIterator< T >::LStackIterator ( LStack< T > &  stack,
size_t  pos = 0 
)

Construct an LStackIterator at position pos.

Definition at line 516 of file LStack.cpp.

◆ LStackIterator() [2/2]

template<typename T >
madara::utility::LStackIterator< T >::LStackIterator ( LStack< T > &  stack,
LStackNode< T > *  pos = 0 
)

Construct an LStackIterator at node pos.

Definition at line 530 of file LStack.cpp.

Member Function Documentation

◆ operator!=()

template<typename T >
bool madara::utility::LStackIterator< T >::operator!= ( const LStackIterator< T > &  lhs) const

Nonequality operator.

Definition at line 508 of file LStack.cpp.

◆ operator*() [1/2]

template<typename T >
T & madara::utility::LStackIterator< T >::operator* ( void  )

Dereference operator returns a reference to the item contained at the current position.

Definition at line 461 of file LStack.cpp.

◆ operator*() [2/2]

template<typename T >
const T & madara::utility::LStackIterator< T >::operator* ( void  ) const

Returns a const reference to the item contained at the current position.

Definition at line 467 of file LStack.cpp.

◆ operator++() [1/2]

template<typename T >
madara::utility::LStackIterator< T > madara::utility::LStackIterator< T >::operator++ ( int  )

Postincrement operator.

Definition at line 484 of file LStack.cpp.

◆ operator++() [2/2]

template<typename T >
madara::utility::LStackIterator< T > & madara::utility::LStackIterator< T >::operator++ ( void  )

Preincrement operator.

Definition at line 473 of file LStack.cpp.

◆ operator==()

template<typename T >
bool madara::utility::LStackIterator< T >::operator== ( const LStackIterator< T > &  rhs) const

Equality operator.

Definition at line 498 of file LStack.cpp.

Member Data Documentation

◆ pos_

template<typename T >
LStackNode<T>* madara::utility::LStackIterator< T >::pos_
mutableprivate

Definition at line 188 of file LStack.h.

◆ stack_

template<typename T >
LStack<T>& madara::utility::LStackIterator< T >::stack_
private

the stack we are dealing with

Definition at line 185 of file LStack.h.


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