Skip to content

DIWNE::RecursiveNodeIteratorImpl

CRTP templated implementation class of the RecursiveNodeIterator. More...

#include "DIWNE/Core/diwne_iterators.h"

Inherits from DIWNE::ForwardNodeIterator< Iterator, NodeType, false >, DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >

Inherited by DIWNE::FilteredRecursiveNodeIterator< NodeType >, DIWNE::RecursiveNodeIterator< NodeType >

Public Types

Name
using typename Super::shared_pointershared_pointer

Protected Types

Name
using NodeIterator<>ChildNodeIterator
using NodeRange<>ChildNodeRange
using bool(*)(const Node *)Predicate
using ForwardNodeIterator< Iterator, NodeType, false >Super

Public Functions

Name
RecursiveNodeIteratorImpl()
RecursiveNodeIteratorImpl(Predicate divePredicate, typename Super::Container nodes, std::size_t idx)
RecursiveNodeIteratorImpl(typename Super::Container nodes, std::size_t idx)
Node *basePtr()<br>Returns the base Node* pointer that isn't casted to the derived NodeType.
referencedereference() const
boolequals(const Iterator & b) const
voidnext()
pointerptr() const
shared_pointersharedPtr() const

Protected Attributes

Name
Predicate_divePredicate <br>Dive predicate, an additional condition required to consider diving inside node's children.
std::stack< ChildNodeIterator, std::vector< ChildNodeIterator > >_stack <br>A stack of child container node iterators, they store their own position at each depth level.

Additional inherited members

Public Types inherited from DIWNE::ForwardNodeIterator< Iterator, NodeType, false >

Name
using const NodeList *Container

Public Functions inherited from DIWNE::ForwardNodeIterator< Iterator, NodeType, false >

Name
ForwardNodeIterator()
ForwardNodeIterator(Container nodes, std::size_t idx)
boolvalid() const<br>Check whether the iterator is pointing at a valid element (eg. not the end of a container)

Protected Attributes inherited from DIWNE::ForwardNodeIterator< Iterator, NodeType, false >

Name
std::size_t_idx <br>Current node index // TODO: Should probably be an int.
Container_nodes <br>Reference to the node list.

Public Types inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >

Name
using std::ptrdiff_tdifference_type
using std::forward_iterator_tagiterator_category
using typename std::conditional< IsConst, const Value *, Value * >::typepointer
using typename std::conditional< IsConst, const Value &, Value & >::typereference
using typename std::conditional< IsConst, const Value, Value >::typevalue_type

Public Functions inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >

Name
referenceoperator*()
Iterator &operator++()
Iteratoroperator++(int )
pointeroperator->()

Protected Functions inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >

Name
ForwardIteratorBase()
virtual~ForwardIteratorBase() =default
Iterator *self()<br>CRTP self pointer (pointer to the derived type)
const Iterator *self() const<br>CRTP const self pointer.
boolvalid() const<br>Check whether the iterator is pointing at a valid element (eg. not the end of a container)

Friends inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >

Name
booloperator!=(const Iterator & a, const Iterator & b)
booloperator==(const Iterator & a, const Iterator & b)

Detailed Description

cpp
template <typename Iterator ,
typename NodeType >
class DIWNE::RecursiveNodeIteratorImpl;
template <typename Iterator ,
typename NodeType >
class DIWNE::RecursiveNodeIteratorImpl;

CRTP templated implementation class of the RecursiveNodeIterator.

See: RecursiveNodeIterator

Public Types Documentation

using shared_pointer

cpp
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::shared_pointer =  typename Super::shared_pointer;
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::shared_pointer =  typename Super::shared_pointer;

Protected Types Documentation

using ChildNodeIterator

cpp
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::ChildNodeIterator =  NodeIterator<>;
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::ChildNodeIterator =  NodeIterator<>;

using ChildNodeRange

cpp
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::ChildNodeRange =  NodeRange<>;
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::ChildNodeRange =  NodeRange<>;

using Predicate

cpp
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::Predicate =  bool (*)(const Node*);
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::Predicate =  bool (*)(const Node*);

using Super

cpp
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::Super =  ForwardNodeIterator<Iterator, NodeType, false>;
using DIWNE::RecursiveNodeIteratorImpl< Iterator, NodeType >::Super =  ForwardNodeIterator<Iterator, NodeType, false>;

Public Functions Documentation

function RecursiveNodeIteratorImpl

cpp
inline RecursiveNodeIteratorImpl()
inline RecursiveNodeIteratorImpl()

function RecursiveNodeIteratorImpl

cpp
inline RecursiveNodeIteratorImpl(
    Predicate divePredicate,
    typename Super::Container nodes,
    std::size_t idx
)
inline RecursiveNodeIteratorImpl(
    Predicate divePredicate,
    typename Super::Container nodes,
    std::size_t idx
)

function RecursiveNodeIteratorImpl

cpp
inline RecursiveNodeIteratorImpl(
    typename Super::Container nodes,
    std::size_t idx
)
inline RecursiveNodeIteratorImpl(
    typename Super::Container nodes,
    std::size_t idx
)

function basePtr

cpp
inline Node * basePtr()
inline Node * basePtr()

Returns the base Node* pointer that isn't casted to the derived NodeType.

function dereference

cpp
inline reference dereference() const
inline reference dereference() const

function equals

cpp
inline bool equals(
    const Iterator & b
) const
inline bool equals(
    const Iterator & b
) const

function next

cpp
void next()
void next()

function ptr

cpp
inline pointer ptr() const
inline pointer ptr() const

function sharedPtr

cpp
inline shared_pointer sharedPtr() const
inline shared_pointer sharedPtr() const

Protected Attributes Documentation

variable _divePredicate

cpp
Predicate _divePredicate {nullptr};
Predicate _divePredicate {nullptr};

Dive predicate, an additional condition required to consider diving inside node's children.

variable _stack

cpp
std::stack< ChildNodeIterator, std::vector< ChildNodeIterator > > _stack;
std::stack< ChildNodeIterator, std::vector< ChildNodeIterator > > _stack;

A stack of child container node iterators, they store their own position at each depth level.


Updated on 2025-05-31 at 12:55:31 +0000