The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Attributes | List of all members
gui2::iteration::tree_node Class Reference

A walker for a gui2::tree_view_node. More...

#include <walker_tree_node.hpp>

Inheritance diagram for gui2::iteration::tree_node:

Public Member Functions

 tree_node (gui2::tree_view_node &node, tree_view_node::node_children_vector &children)
 Constructor. More...
 
virtual state_t next (const level level)
 Inherited from gui2::iteration::walker_base. More...
 
virtual bool at_end (const level level) const
 Inherited from gui2::iteration::walker_base. More...
 
virtual gui2::widgetget (const level level)
 Inherited from gui2::iteration::walker_base. More...
 
- Public Member Functions inherited from gui2::iteration::walker_base
virtual ~walker_base ()
 

Private Attributes

tree_view_node::node_children_vectorchildren_
 The children of the node which the walker is attached to. More...
 
gui2::widgetwidget_
 The node which the walker is attached to. More...
 
tree_view_node::node_children_vector::iterator itor_
 The iterator to the children of the node. More...
 

Additional Inherited Members

- Public Types inherited from gui2::iteration::walker_base
enum  level { self , internal , child }
 The level to walk at. More...
 
enum  state_t { valid , invalid , fail }
 The state of the walker. More...
 

Detailed Description

A walker for a gui2::tree_view_node.

Definition at line 26 of file walker_tree_node.hpp.

Constructor & Destructor Documentation

◆ tree_node()

gui2::iteration::tree_node::tree_node ( gui2::tree_view_node node,
tree_view_node::node_children_vector children 
)

Constructor.

Parameters
nodeThe tree view node which the walker is attached to.
childrenThe node's children.

Definition at line 25 of file walker_tree_node.cpp.

Member Function Documentation

◆ at_end()

bool gui2::iteration::tree_node::at_end ( const level  level) const
virtual

Inherited from gui2::iteration::walker_base.

Implements gui2::iteration::walker_base.

Definition at line 57 of file walker_tree_node.cpp.

References gui2::iteration::walker_base::child, children_, itor_, and widget_.

Referenced by next().

◆ get()

gui2::widget * gui2::iteration::tree_node::get ( const level  level)
virtual

◆ next()

walker_base::state_t gui2::iteration::tree_node::next ( const level  level)
virtual

Member Data Documentation

◆ children_

tree_view_node::node_children_vector& gui2::iteration::tree_node::children_
private

The children of the node which the walker is attached to.

Definition at line 48 of file walker_tree_node.hpp.

Referenced by at_end(), get(), and next().

◆ itor_

tree_view_node::node_children_vector::iterator gui2::iteration::tree_node::itor_
private

The iterator to the children of the node.

This variable is used to track where the gui2::iteration::walker_base::child level visiting is.

Definition at line 64 of file walker_tree_node.hpp.

Referenced by at_end(), get(), and next().

◆ widget_

gui2::widget* gui2::iteration::tree_node::widget_
private

The node which the walker is attached to.

This variable is used to track whether the gui2::iteration::walker_base::widget level has been visited.

Definition at line 56 of file walker_tree_node.hpp.

Referenced by at_end(), get(), and next().


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