The Battle for Wesnoth  1.19.0-dev
Public Member Functions | List of all members
gui2::iteration::iterator< order > Class Template Reference

The iterator class. More...

#include <iterator.hpp>

Inheritance diagram for gui2::iteration::iterator< order >:

Public Member Functions

 iterator (const iterator &)=delete
 
iteratoroperator= (const iterator &)=delete
 
 iterator (widget &root)
 Constructor. More...
 
bool at_end () const
 Has the iterator reached the end? More...
 
bool next ()
 Visit the next widget. More...
 
iterator< order > & operator++ ()
 See next. More...
 
widgetoperator* ()
 Returns the current widget. More...
 
widgetoperator-> ()
 See operator*. More...
 
widgetget ()
 See operator*. More...
 

Detailed Description

template<class order>
class gui2::iteration::iterator< order >

The iterator class.

See Iterator for more information.

Definition at line 36 of file iterator.hpp.

Constructor & Destructor Documentation

◆ iterator() [1/2]

template<class order >
gui2::iteration::iterator< order >::iterator ( const iterator< order > &  )
delete

◆ iterator() [2/2]

template<class order >
gui2::iteration::iterator< order >::iterator ( widget root)
inline

Constructor.

Parameters
rootThe widget where to start the iteration.

Definition at line 47 of file iterator.hpp.

Member Function Documentation

◆ at_end()

template<class order >
bool gui2::iteration::iterator< order >::at_end ( ) const
inline

Has the iterator reached the end?

Returns
The status.
Return values
[true]At the end.
[false]Not at the end.

Definition at line 58 of file iterator.hpp.

Referenced by gui2::dialogs::select_orb_colors::setup_orb_group().

◆ get()

template<class order >
widget* gui2::iteration::iterator< order >::get ( )
inline

See operator*.

Definition at line 104 of file iterator.hpp.

References gui2::iteration::iterator< order >::operator->().

◆ next()

template<class order >
bool gui2::iteration::iterator< order >::next ( )
inline

Visit the next widget.

Precondition
The following assertion holds:
at_end() == false
bool at_end() const
Has the iterator reached the end?
Definition: iterator.hpp:58
Exceptions
Arange_error exception upon pre condition violation.
Returns
Whether the next widget can be safely deferred.

Definition at line 75 of file iterator.hpp.

◆ operator*()

template<class order >
widget& gui2::iteration::iterator< order >::operator* ( )
inline

Returns the current widget.

Returns
The current widget.

Definition at line 92 of file iterator.hpp.

Referenced by gui2::iteration::iterator< order >::operator->().

◆ operator++()

template<class order >
iterator<order>& gui2::iteration::iterator< order >::operator++ ( )
inline

See next.

Definition at line 81 of file iterator.hpp.

◆ operator->()

template<class order >
widget* gui2::iteration::iterator< order >::operator-> ( )
inline

◆ operator=()

template<class order >
iterator& gui2::iteration::iterator< order >::operator= ( const iterator< order > &  )
delete

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