DIWNE::FilteredNodeIteratorImpl
Node iterator that returns only nodes that pass a specified condition. More...
#include "DIWNE/Core/diwne_iterators.h"
Inherits from DIWNE::BidirectionalNodeIterator< Iterator, NodeType, IsConst >, DIWNE::ForwardNodeIterator< Iterator, NodeType, IsConst >, DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >
Inherited by DIWNE::FilteredNodeIterator< NodeType >
Public Types
Name | |
---|---|
using typename Super::shared_pointer | shared_pointer |
Protected Types
Name | |
---|---|
using bool(*)(const Node *) | Predicate |
using BidirectionalNodeIterator< Iterator, NodeType, IsConst > | Super |
Public Functions
Name | |
---|---|
FilteredNodeIteratorImpl() | |
FilteredNodeIteratorImpl(Predicate predicate, typename Super::Container nodes, std::size_t idx) | |
virtual void | back()<br>Move the iterator to the previous position. |
void | next() |
bool | valid() const |
Protected Attributes
Name | |
---|---|
Predicate | _predicate |
Additional inherited members
Public Types inherited from DIWNE::BidirectionalNodeIterator< Iterator, NodeType, IsConst >
Name | |
---|---|
using std::bidirectional_iterator_tag | iterator_category |
Public Functions inherited from DIWNE::BidirectionalNodeIterator< Iterator, NodeType, IsConst >
Name | |
---|---|
BidirectionalNodeIterator() | |
BidirectionalNodeIterator(Super::Container nodes, std::size_t idx) | |
Iterator & | operator--() |
Iterator | operator--(int ) |
Public Types inherited from DIWNE::ForwardNodeIterator< Iterator, NodeType, IsConst >
Name | |
---|---|
using const NodeList * | Container |
Public Functions inherited from DIWNE::ForwardNodeIterator< Iterator, NodeType, IsConst >
Name | |
---|---|
ForwardNodeIterator() | |
ForwardNodeIterator(Container nodes, std::size_t idx) | |
reference | dereference() const |
bool | equals(const Iterator & b) const<br>Determines whether this iterator is pointing to the same element as another one (used by the == operator) |
pointer | ptr() const |
shared_pointer | sharedPtr() const |
Protected Attributes inherited from DIWNE::ForwardNodeIterator< Iterator, NodeType, IsConst >
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_t | difference_type |
using std::forward_iterator_tag | iterator_category |
using typename std::conditional< IsConst, const Value *, Value * >::type | pointer |
using typename std::conditional< IsConst, const Value &, Value & >::type | reference |
using typename std::conditional< IsConst, const Value, Value >::type | value_type |
Public Functions inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >
Name | |
---|---|
reference | operator*() |
Iterator & | operator++() |
Iterator | operator++(int ) |
pointer | operator->() |
Protected Functions inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >
Name | |
---|---|
ForwardIteratorBase() | |
virtual | ~ForwardIteratorBase() =default |
reference | dereference() const<br>Return a reference to the current element (reference to a value type, not a pointer). |
bool | equals(const Iterator & b) const<br>Determines whether this iterator is pointing to the same element as another one (used by the == operator) |
pointer | ptr() const<br>Return a raw pointer to the current element. |
Iterator * | self()<br>CRTP self pointer (pointer to the derived type) |
const Iterator * | self() const<br>CRTP const self pointer. |
std::shared_ptr< Value > | sharedPtr() const<br>Return the owning pointer to the current element. Creates a new shared pointer object. |
Friends inherited from DIWNE::ForwardIteratorBase< Iterator, NodeType, IsConst >
Name | |
---|---|
bool | operator!=(const Iterator & a, const Iterator & b) |
bool | operator==(const Iterator & a, const Iterator & b) |
Detailed Description
template <typename Iterator ,
typename NodeType ,
bool IsConst>
class DIWNE::FilteredNodeIteratorImpl;
template <typename Iterator ,
typename NodeType ,
bool IsConst>
class DIWNE::FilteredNodeIteratorImpl;
Node iterator that returns only nodes that pass a specified condition.
Template Parameters:
- Iterator Type returned by begin()/end() (the CRTP derived iterator)
See: NodeIterator, FilteredRecursiveNodeIterator
Unlike the regular NodeIterator, it does not have random access, but it can move forwards and backwards.
Public Types Documentation
using shared_pointer
using DIWNE::FilteredNodeIteratorImpl< Iterator, NodeType, IsConst >::shared_pointer = typename Super::shared_pointer;
using DIWNE::FilteredNodeIteratorImpl< Iterator, NodeType, IsConst >::shared_pointer = typename Super::shared_pointer;
Protected Types Documentation
using Predicate
using DIWNE::FilteredNodeIteratorImpl< Iterator, NodeType, IsConst >::Predicate = bool (*)(const Node*);
using DIWNE::FilteredNodeIteratorImpl< Iterator, NodeType, IsConst >::Predicate = bool (*)(const Node*);
using Super
using DIWNE::FilteredNodeIteratorImpl< Iterator, NodeType, IsConst >::Super = BidirectionalNodeIterator<Iterator, NodeType, IsConst>;
using DIWNE::FilteredNodeIteratorImpl< Iterator, NodeType, IsConst >::Super = BidirectionalNodeIterator<Iterator, NodeType, IsConst>;
Public Functions Documentation
function FilteredNodeIteratorImpl
inline FilteredNodeIteratorImpl()
inline FilteredNodeIteratorImpl()
function FilteredNodeIteratorImpl
inline FilteredNodeIteratorImpl(
Predicate predicate,
typename Super::Container nodes,
std::size_t idx
)
inline FilteredNodeIteratorImpl(
Predicate predicate,
typename Super::Container nodes,
std::size_t idx
)
function back
inline virtual void back()
inline virtual void back()
Move the iterator to the previous position.
Reimplements: DIWNE::BidirectionalNodeIterator::back
function next
inline void next()
inline void next()
function valid
inline bool valid() const
inline bool valid() const
Protected Attributes Documentation
variable _predicate
Predicate _predicate {nullptr};
Predicate _predicate {nullptr};
Updated on 2025-05-31 at 12:55:31 +0000