Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator Struct Reference

Iterator over the nodes. More...

#include <tpl_avl.H>

Inheritance diagram for Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator:
[legend]
Collaboration diagram for Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator:
[legend]

Public Member Functions

 Iterator () noexcept=default
 Default constructor creates an "end" iterator.
 
 Iterator (Gen_Avl_Tree &t)
 
 Iterator (const Gen_Avl_Tree &tree)
 
- Public Member Functions inherited from Aleph::BinNodeInfixIterator< Node >
bool is_in_first () const noexcept
 Return true if the iterator is on the first node.
 
bool is_last () const noexcept
 
void swap (BinNodeInfixIterator &it) noexcept
 
 BinNodeInfixIterator ()=default
 
 BinNodeInfixIterator (Node *r)
 Initialize an iterator on the first node inorder.
 
 BinNodeInfixIterator (const BinNodeInfixIterator &it)
 
 BinNodeInfixIterator (BinNodeInfixIterator &&it) noexcept
 
void reset_first ()
 Reset the iterator to the first node inorder; it may throw bad_alloc, as the constructor does.
 
void reset_last () noexcept
 Reset the iterator to the last node inorder.
 
void end () noexcept
 
BinNodeInfixIterator & operator= (const BinNodeInfixIterator &it)
 
BinNodeInfixIterator & operator= (BinNodeInfixIterator &&it) noexcept
 
bool has_curr () const noexcept
 Return true the iterator has current node.
 
Node * get_curr_ne () const noexcept
 Return the current link guaranteeing no exception. Be careful.
 
Node * get_curr () const
 Return the current node. Throw overflow_error if there is no current.
 
size_t get_pos () const
 Return the current position of iterator. Only valid if has_curr() == true.
 
void next_ne ()
 Move forward without checking the position; it may throw bad_alloc, as the constructor does.
 
void next ()
 Move the iterator one position forward.
 

Detailed Description

template<template< typename > class NodeType, typename Key, class Compare>
struct Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator

Iterator over the nodes.

This class allows traversing the tree nodes in sorted order according to the comparison criterion specified at tree instantiation.

Definition at line 803 of file tpl_avl.H.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<template< typename > class NodeType, typename Key , class Compare >
Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator::Iterator ( )
defaultnoexcept

Default constructor creates an "end" iterator.

◆ Iterator() [2/3]

template<template< typename > class NodeType, typename Key , class Compare >
Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator::Iterator ( Gen_Avl_Tree &  t)
inline

Definition at line 808 of file tpl_avl.H.

◆ Iterator() [3/3]

template<template< typename > class NodeType, typename Key , class Compare >
Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::Iterator::Iterator ( const Gen_Avl_Tree &  tree)
inline

Definition at line 810 of file tpl_avl.H.


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