carl  24.04
Computer ARithmetic Library
carl::tree_detail::BaseIterator< T, Iterator, reverse > Struct Template Reference

This is the base class for all iterators. More...

#include <carlTree.h>

Inheritance diagram for carl::tree_detail::BaseIterator< T, Iterator, reverse >:

Public Member Functions

const auto & nodes () const
 
const auto & node (std::size_t id) const
 
const auto & curnode () const
 
 BaseIterator (const BaseIterator &ii)=default
 
 BaseIterator (BaseIterator &&ii) noexcept=default
 
template<typename It , bool r>
 BaseIterator (const BaseIterator< T, It, r > &ii)
 
BaseIteratoroperator= (const BaseIterator &ii)=default
 
BaseIteratoroperator= (BaseIterator &&ii) noexcept=default
 
std::size_t depth () const
 
std::size_t id () const
 
bool isRoot () const
 
bool isValid () const
 
T * operator-> ()
 
T const * operator-> () const
 

Data Fields

std::size_t current
 

Protected Member Functions

 BaseIterator (const tree< T > *t, std::size_t root)
 

Protected Attributes

const tree< T > * mTree
 

Friends

template<typename TT , typename It , bool rev>
struct BaseIterator
 

Detailed Description

template<typename T, typename Iterator, bool reverse>
struct carl::tree_detail::BaseIterator< T, Iterator, reverse >

This is the base class for all iterators.

It takes care of correct implementation of all operators and reversion.

An actual iterator T<reverse> only has to

  • inherit from BaseIterator<T, reverse>,
  • provide appropriate constructors,
  • implement next() and previous(). If the iterator supports only forward iteration, it omits the template argument, inherits from BaseIterator<T, false> and does not implement previous().

Definition at line 72 of file carlTree.h.

Constructor & Destructor Documentation

◆ BaseIterator() [1/4]

template<typename T , typename Iterator , bool reverse>
carl::tree_detail::BaseIterator< T, Iterator, reverse >::BaseIterator ( const tree< T > *  t,
std::size_t  root 
)
inlineprotected

Definition at line 77 of file carlTree.h.

◆ BaseIterator() [2/4]

template<typename T , typename Iterator , bool reverse>
carl::tree_detail::BaseIterator< T, Iterator, reverse >::BaseIterator ( const BaseIterator< T, Iterator, reverse > &  ii)
default

◆ BaseIterator() [3/4]

template<typename T , typename Iterator , bool reverse>
carl::tree_detail::BaseIterator< T, Iterator, reverse >::BaseIterator ( BaseIterator< T, Iterator, reverse > &&  ii)
defaultnoexcept

◆ BaseIterator() [4/4]

template<typename T , typename Iterator , bool reverse>
template<typename It , bool r>
carl::tree_detail::BaseIterator< T, Iterator, reverse >::BaseIterator ( const BaseIterator< T, It, r > &  ii)
inline

Definition at line 93 of file carlTree.h.

Member Function Documentation

◆ curnode()

template<typename T , typename Iterator , bool reverse>
const auto& carl::tree_detail::BaseIterator< T, Iterator, reverse >::curnode ( ) const
inline

Definition at line 86 of file carlTree.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ depth()

template<typename T , typename Iterator , bool reverse>
std::size_t carl::tree_detail::BaseIterator< T, Iterator, reverse >::depth ( ) const
inline

Definition at line 96 of file carlTree.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id()

template<typename T , typename Iterator , bool reverse>
std::size_t carl::tree_detail::BaseIterator< T, Iterator, reverse >::id ( ) const
inline

Definition at line 99 of file carlTree.h.

Here is the caller graph for this function:

◆ isRoot()

template<typename T , typename Iterator , bool reverse>
bool carl::tree_detail::BaseIterator< T, Iterator, reverse >::isRoot ( ) const
inline

Definition at line 103 of file carlTree.h.

◆ isValid()

template<typename T , typename Iterator , bool reverse>
bool carl::tree_detail::BaseIterator< T, Iterator, reverse >::isValid ( ) const
inline

Definition at line 106 of file carlTree.h.

◆ node()

template<typename T , typename Iterator , bool reverse>
const auto& carl::tree_detail::BaseIterator< T, Iterator, reverse >::node ( std::size_t  id) const
inline

Definition at line 82 of file carlTree.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nodes()

template<typename T , typename Iterator , bool reverse>
const auto& carl::tree_detail::BaseIterator< T, Iterator, reverse >::nodes ( ) const
inline

Definition at line 79 of file carlTree.h.

Here is the caller graph for this function:

◆ operator->() [1/2]

template<typename T , typename Iterator , bool reverse>
T* carl::tree_detail::BaseIterator< T, Iterator, reverse >::operator-> ( )
inline

Definition at line 109 of file carlTree.h.

Here is the call graph for this function:

◆ operator->() [2/2]

template<typename T , typename Iterator , bool reverse>
T const* carl::tree_detail::BaseIterator< T, Iterator, reverse >::operator-> ( ) const
inline

Definition at line 112 of file carlTree.h.

Here is the call graph for this function:

◆ operator=() [1/2]

template<typename T , typename Iterator , bool reverse>
BaseIterator& carl::tree_detail::BaseIterator< T, Iterator, reverse >::operator= ( BaseIterator< T, Iterator, reverse > &&  ii)
defaultnoexcept

◆ operator=() [2/2]

template<typename T , typename Iterator , bool reverse>
BaseIterator& carl::tree_detail::BaseIterator< T, Iterator, reverse >::operator= ( const BaseIterator< T, Iterator, reverse > &  ii)
default
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ BaseIterator

template<typename T , typename Iterator , bool reverse>
template<typename TT , typename It , bool rev>
friend struct BaseIterator
friend

Definition at line 74 of file carlTree.h.

Field Documentation

◆ current

template<typename T , typename Iterator , bool reverse>
std::size_t carl::tree_detail::BaseIterator< T, Iterator, reverse >::current

Definition at line 89 of file carlTree.h.

◆ mTree

template<typename T , typename Iterator , bool reverse>
const tree<T>* carl::tree_detail::BaseIterator< T, Iterator, reverse >::mTree
protected

Definition at line 76 of file carlTree.h.


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