Public Types | Public Member Functions

gui2::iterator::twalker_ Class Reference

The walker abstract base class. More...

#include <walker.hpp>

Inheritance diagram for gui2::iterator::twalker_:
Inheritance graph
[legend]

List of all members.

Public Types

enum  tlevel { widget, grid, child }
 

The level to walk at.

More...
enum  tstate { valid, invalid, fail }
 

The state of the walker.

More...

Public Member Functions

virtual ~twalker_ ()
virtual tstate next (const tlevel level)=0
 Make the next widget the current one.
virtual bool at_end (const tlevel level) const =0
 Returns whether the current widget is valid.
virtual gui2::twidgetget (const tlevel level)=0
 Returns a pointer to the current widget.

Detailed Description

The walker abstract base class.

Definition at line 26 of file walker.hpp.


Member Enumeration Documentation

The level to walk at.

Enumerator:
widget 

Visit the widget itself.

Visit its nested grid.

grid 

Visit the children of its nested grid.

child 

Definition at line 33 of file walker.hpp.

The state of the walker.

The enum is used to return the state of next.

Enumerator:
valid 

When calling next the following it has the following results.

Precondition:
at_end == false
Postcondition:
the next widget became the current one.
at_end == false When calling next the following it has the following results.
Precondition:
at_end == false
Postcondition:
there is no longer a current widget.
at_end == true
invalid 

When calling next the following it has the following results.

Precondition:
at_end == true
Postcondition:
at_end == true
fail 

Definition at line 48 of file walker.hpp.


Constructor & Destructor Documentation

virtual gui2::iterator::twalker_::~twalker_ (  )  [inline, virtual]

Definition at line 30 of file walker.hpp.


Member Function Documentation

virtual bool gui2::iterator::twalker_::at_end ( const tlevel  level  )  const [pure virtual]

Returns whether the current widget is valid.

Parameters:
level Determines on which level the test should be executed.
Returns:
Whether the current widget is valid.

Implemented in gui2::iterator::tgrid, and gui2::iterator::walker::twidget.

Referenced by gui2::iterator::policy::visit::tvisit< level >::at_end().

Here is the caller graph for this function:

virtual gui2::twidget* gui2::iterator::twalker_::get ( const tlevel  level  )  [pure virtual]

Returns a pointer to the current widget.

Precondition:
at_end(level) == false
Parameters:
level Determines from which level should the current widget be returned.
Returns:
Pointer to the current widget.

Implemented in gui2::iterator::tgrid, and gui2::iterator::walker::twidget.

virtual tstate gui2::iterator::twalker_::next ( const tlevel  level  )  [pure virtual]

Make the next widget the current one.

Parameters:
level Determines on which level the next one should be selected.
Returns:
The status of the operation.

Implemented in gui2::iterator::tgrid, and gui2::iterator::walker::twidget.

Referenced by gui2::iterator::policy::visit::tvisit< level >::next().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:24:10 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs