Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::concept::Iterator< T > Class Template Reference

#include </home/casse/otawa/elm/src/concepts.h>

+ Inheritance diagram for elm::concept::Iterator< T >:

Public Member Functions

 Iterator (const Iterator &iterator)
 
bool ended (void)
 
void next (void)
 
const T & item (void)
 
 operator bool (void)
 
 operator const T & (void)
 
Iteratoroperator++ (int)
 
Iteratoroperator= (const Iterator &iterator)
 

Detailed Description

template<class T>
class elm::concept::Iterator< T >

This concept is matched by all iterators. It provides a way to traverse a collection of items. Class matching this concept must defines the following methods.

Parameters
TType of items of the collection.

Constructor & Destructor Documentation

template<class T>
elm::concept::Iterator< T >::Iterator ( const Iterator< T > &  iterator)

Just a clone constructor.

Parameters
iteratorIterator to clone.

Member Function Documentation

template<class T>
bool elm::concept::Iterator< T >::ended ( void  )

Test if the end of the traversal is reached.

Returns
True if end is reached, false else.
template<class T>
const T& elm::concept::Iterator< T >::item ( void  )

Get the current item.

Returns
Current item.
Warning
Do not call this method when ended() == true !
template<class T>
void Iterator::next ( void  )

Go to the next item.

Go to the next item of the iteration. It is an error to call it when ended() return true.

template<class T>
Iterator::operator bool ( void  )

Same as ! ended().

Like item() function but looks nicer.

Note
Don't use with bool as generic type, an ambiguity will appear due to both automatic conversion to bool.
template<class T>
elm::concept::Iterator< T >::operator const T & ( void  )

Same as item().

template<class T>
Iterator< T > & Iterator::operator++ ( int  _)

Same as next().

As next() function but looks nicer.

template<class T>
Iterator& elm::concept::Iterator< T >::operator= ( const Iterator< T > &  iterator)

Assign an operator position to the current one.

Parameters
iteratorIterator to set the position of.
Returns
Current iterator.

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