NEST main@f146f75
Loading...
Searching...
No Matches
nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator Class Reference

Iterator iterating the nodes in a Quadtree inside a Mask. More...

#include <ntree.h>

Collaboration diagram for nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator:
[legend]

Public Types

using iterator_category = std::forward_iterator_tag
using value_type = std::pair< Position< D >, T >
using pointer = value_type*
using reference = value_type&
using difference_type = long int

Public Member Functions

 masked_iterator ()
 Initialize an invalid iterator.
 masked_iterator (Ntree &q, const Mask< D > &mask, const Position< D > &anchor)
 Initialize an iterator to point to the first leaf node inside the mask within the tree below this Ntree.
value_type & operator* ()
value_type * operator-> ()
masked_iterator & operator++ ()
 Move the iterator to the next node inside the mask within the tree.
masked_iterator operator++ (int)
 Postfix increment operator.
bool operator== (const masked_iterator &other) const
 Iterators are equal if they point to the same node in the same ntree.
bool operator!= (const masked_iterator &other) const

Protected Member Functions

void init_ ()
 Initialize.
void next_leaf_ ()
 Find the next leaf which is not outside the mask.
void first_leaf_ ()
 Find the first leaf which is not outside the mask.
void first_leaf_inside_ ()
 Set the allin_top_ to the current quadrant, and find the first leaf below the current quadrant.
void next_anchor_ ()
 Go to the next anchor image.
bool anchored_position_inside_mask (const Position< D > &position)

Protected Attributes

Ntree * ntree_
Ntree * top_
Ntree * allin_top_
size_t node_
const Mask< D > * mask_
Position< D > anchor_
Position< D > anchored_position_
std::vector< Position< D > > anchors_
size_t current_anchor_

Detailed Description

template<int D, class T, int max_capacity = 100, int max_depth = 10>
class nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator

Iterator iterating the nodes in a Quadtree inside a Mask.

Member Typedef Documentation

◆ difference_type

template<int D, class T, int max_capacity = 100, int max_depth = 10>
using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::difference_type = long int

◆ iterator_category

template<int D, class T, int max_capacity = 100, int max_depth = 10>
using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::iterator_category = std::forward_iterator_tag

◆ pointer

template<int D, class T, int max_capacity = 100, int max_depth = 10>
using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::pointer = value_type*

◆ reference

template<int D, class T, int max_capacity = 100, int max_depth = 10>
using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::reference = value_type&

◆ value_type

template<int D, class T, int max_capacity = 100, int max_depth = 10>
using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::value_type = std::pair< Position< D >, T >

Constructor & Destructor Documentation

◆ masked_iterator() [1/2]

template<int D, class T, int max_capacity = 100, int max_depth = 10>
nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::masked_iterator ( )
inline

Initialize an invalid iterator.

References allin_top_, mask_, node_, ntree_, and top_.

Referenced by operator!=(), operator++(), and operator==().

Here is the caller graph for this function:

◆ masked_iterator() [2/2]

template<int D, class T, int max_capacity, int max_depth>
nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::masked_iterator ( Ntree & q,
const Mask< D > & mask,
const Position< D > & anchor )

Initialize an iterator to point to the first leaf node inside the mask within the tree below this Ntree.

References allin_top_, anchor_, anchors_, current_anchor_, mask_, node_, nest::Ntree< D, T, max_capacity, max_depth >::Ntree(), ntree_, and top_.

Here is the call graph for this function:

Member Function Documentation

◆ anchored_position_inside_mask()

template<int D, class T, int max_capacity = 100, int max_depth = 10>
bool nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::anchored_position_inside_mask ( const Position< D > & position)
inlineprotected

References anchor_, anchored_position_, and mask_.

Referenced by operator++().

Here is the caller graph for this function:

◆ first_leaf_()

template<int D, class T, int max_capacity, int max_depth>
void nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::first_leaf_ ( )
protected

Find the first leaf which is not outside the mask.

If no leaf is found below the current quadrant, will continue to next_leaf_().

References anchor_, first_leaf_inside_(), mask_, next_leaf_(), and ntree_.

Referenced by init_(), and next_leaf_().

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

◆ first_leaf_inside_()

template<int D, class T, int max_capacity, int max_depth>
void nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::first_leaf_inside_ ( )
protected

Set the allin_top_ to the current quadrant, and find the first leaf below the current quadrant.

References allin_top_, and ntree_.

Referenced by first_leaf_(), init_(), and next_leaf_().

Here is the caller graph for this function:

◆ init_()

template<int D, class T, int max_capacity, int max_depth>
void nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::init_ ( )
protected

Initialize.

References allin_top_, anchor_, first_leaf_(), first_leaf_inside_(), mask_, next_anchor_(), node_, ntree_, and top_.

Referenced by next_anchor_().

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

◆ next_anchor_()

template<int D, class T, int max_capacity, int max_depth>
void nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::next_anchor_ ( )
protected

Go to the next anchor image.

References anchor_, anchors_, current_anchor_, init_(), node_, and ntree_.

Referenced by init_(), and next_leaf_().

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

◆ next_leaf_()

template<int D, class T, int max_capacity, int max_depth>
void nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::next_leaf_ ( )
protected

Find the next leaf which is not outside the mask.

References allin_top_, anchor_, anchored_position_, first_leaf_(), first_leaf_inside_(), mask_, nest::Ntree< D, T, max_capacity, max_depth >::N, next_anchor_(), ntree_, and top_.

Referenced by first_leaf_(), and operator++().

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

◆ operator!=()

template<int D, class T, int max_capacity = 100, int max_depth = 10>
bool nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator!= ( const masked_iterator & other) const
inline

References masked_iterator(), node_, and ntree_.

Here is the call graph for this function:

◆ operator*()

template<int D, class T, int max_capacity = 100, int max_depth = 10>
value_type & nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator* ( )
inline

References node_, and ntree_.

◆ operator++() [1/2]

template<int D, class T, int max_capacity, int max_depth>
Ntree< D, T, max_capacity, max_depth >::masked_iterator & nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator++ ( )

Move the iterator to the next node inside the mask within the tree.

May cause the iterator to become invalid if there are no more nodes.

References allin_top_, anchored_position_inside_mask(), next_leaf_(), node_, nest::Ntree< D, T, max_capacity, max_depth >::nodes_, and ntree_.

Here is the call graph for this function:

◆ operator++() [2/2]

template<int D, class T, int max_capacity = 100, int max_depth = 10>
masked_iterator nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator++ ( int )
inline

Postfix increment operator.

References masked_iterator().

Here is the call graph for this function:

◆ operator->()

template<int D, class T, int max_capacity = 100, int max_depth = 10>
value_type * nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator-> ( )
inline

References node_, and ntree_.

◆ operator==()

template<int D, class T, int max_capacity = 100, int max_depth = 10>
bool nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator== ( const masked_iterator & other) const
inline

Iterators are equal if they point to the same node in the same ntree.

References masked_iterator(), node_, and ntree_.

Here is the call graph for this function:

Member Data Documentation

◆ allin_top_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
Ntree* nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::allin_top_
protected

◆ anchor_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
Position< D > nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::anchor_
protected

◆ anchored_position_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
Position< D > nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::anchored_position_
protected

◆ anchors_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
std::vector< Position< D > > nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::anchors_
protected

Referenced by masked_iterator(), and next_anchor_().

◆ current_anchor_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
size_t nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::current_anchor_
protected

Referenced by masked_iterator(), and next_anchor_().

◆ mask_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
const Mask< D >* nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::mask_
protected

◆ node_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
size_t nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::node_
protected

◆ ntree_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
Ntree* nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::ntree_
protected

◆ top_

template<int D, class T, int max_capacity = 100, int max_depth = 10>
Ntree* nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::top_
protected

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