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

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

#include <ntree.h>

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

Public Member Functions

 iterator ()
 Initialize an invalid iterator.
 
 iterator (Ntree &q)
 Initialize an iterator to point to the first node in the first non-empty leaf within the tree below this Ntree.
 
 iterator (Ntree &q, size_t n)
 Initialize an iterator to point to the nth node in this Ntree, which must be a leaf.
 
value_type & operator* ()
 
value_type * operator-> ()
 
iterator & operator++ ()
 Move the iterator to the next node within the tree.
 
iterator operator++ (int)
 Postfix increment operator.
 
bool operator== (const iterator &other) const
 Iterators are equal if they point to the same node in the same ntree.
 
bool operator!= (const iterator &other) const
 

Protected Member Functions

void next_leaf_ ()
 Move to the next leaf quadrant, or set ntree_ to 0 if there are no more leaves.
 

Protected Attributes

Ntree * ntree_
 
Ntree * top_
 
size_t node_
 

Detailed Description

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

Iterator iterating the nodes in a Quadtree.

Constructor & Destructor Documentation

◆ iterator() [1/3]

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

Initialize an invalid iterator.

◆ iterator() [2/3]

template<int D, class T , int max_capacity, int max_depth>
nest::Ntree< D, T, max_capacity, max_depth >::iterator::iterator ( Ntree &  q)
explicit

Initialize an iterator to point to the first node in the first non-empty leaf within the tree below this Ntree.

References nest::Ntree< D, T, max_capacity, max_depth >::children_, nest::Ntree< D, T, max_capacity, max_depth >::is_leaf(), nest::Ntree< D, T, max_capacity, max_depth >::iterator::next_leaf_(), nest::Ntree< D, T, max_capacity, max_depth >::nodes_, and nest::Ntree< D, T, max_capacity, max_depth >::iterator::ntree_.

Here is the call graph for this function:

◆ iterator() [3/3]

template<int D, class T , int max_capacity, int max_depth>
nest::Ntree< D, T, max_capacity, max_depth >::iterator::iterator ( Ntree &  q,
size_t  n 
)

Member Function Documentation

◆ next_leaf_()

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

Move to the next leaf quadrant, or set ntree_ to 0 if there are no more leaves.

References nest::Ntree< D, T, max_capacity, max_depth >::N.

Referenced by nest::Ntree< D, T, max_capacity, max_depth >::iterator::iterator().

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 >::iterator::operator!= ( const iterator &  other) const
inline

◆ operator*()

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

◆ operator++() [1/2]

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

Move the iterator to the next node within the tree.

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

◆ operator++() [2/2]

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

Postfix increment operator.

◆ operator->()

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

◆ operator==()

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

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

References nest::Ntree< D, T, max_capacity, max_depth >::iterator::node_, and nest::Ntree< D, T, max_capacity, max_depth >::iterator::ntree_.

Member Data Documentation

◆ node_

◆ ntree_

◆ top_

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

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