File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator Class Reference

Built-in iterator on an HashTree. This iterator visits all node in the tree. More...

#include <DGtal/images/ImageContainerByHashTree.h>

Public Member Functions

 Iterator (Node **data, unsigned int position, unsigned int arraySize)
bool isAtEnd () const
Valueoperator* ()
bool operator++ ()
bool operator== (const Iterator &it)
bool operator!= (const Iterator &it)
HashKey getKey () const
bool next ()

Protected Attributes

NodemyNode
unsigned int myCurrentCell
unsigned int myArraySize
Node ** myContainerData

Detailed Description

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
class DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator

Built-in iterator on an HashTree. This iterator visits all node in the tree.

Iterator inner-class


Definition at line 506 of file ImageContainerByHashTree.h.

Constructor & Destructor Documentation

◆ Iterator()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::Iterator ( Node ** data,
unsigned int position,
unsigned int arraySize )
inline

Definition at line 509 of file ImageContainerByHashTree.h.

510 {
513 myNode = data[0];
515 while ((!myNode) && (myCurrentCell < myArraySize))
516 {
518 }
519 }
Model of CImageContainer implementing the association key<->Value using a hash tree....

References DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::data(), myArraySize, myContainerData, myCurrentCell, and myNode.

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

Member Function Documentation

◆ getKey()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
HashKey DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::getKey ( ) const
inline

Definition at line 546 of file ImageContainerByHashTree.h.

547 {
548 return myNode->getKey();
549 }
HashKey getKey(const Point &aPoint) const

References myNode.

◆ isAtEnd()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
bool DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::isAtEnd ( ) const
inline

Definition at line 520 of file ImageContainerByHashTree.h.

521 {
522 return myCurrentCell >= myArraySize;
523 }

References myArraySize, and myCurrentCell.

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

◆ next()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
bool DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::next ( )

Referenced by operator++().

◆ operator!=()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
bool DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::operator!= ( const Iterator & it)
inline

Definition at line 539 of file ImageContainerByHashTree.h.

540 {
541 if (isAtEnd() && it.isAtEnd())
542 return false;
543 else
544 return (myNode != it.myNode);
545 }

References isAtEnd(), Iterator(), and myNode.

◆ operator*()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
Value & DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::operator* ( )
inline

Definition at line 524 of file ImageContainerByHashTree.h.

525 {
526 return myNode->getObject();
527 }

References myNode.

◆ operator++()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
bool DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::operator++ ( )
inline

Definition at line 528 of file ImageContainerByHashTree.h.

529 {
530 return next();
531 }

References next().

◆ operator==()

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
bool DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::operator== ( const Iterator & it)
inline

Definition at line 532 of file ImageContainerByHashTree.h.

533 {
534 if (isAtEnd() && it.isAtEnd())
535 return true;
536 else
537 return (myNode == it.myNode);
538 }

References isAtEnd(), Iterator(), and myNode.

Field Documentation

◆ myArraySize

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
unsigned int DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::myArraySize
protected

Definition at line 554 of file ImageContainerByHashTree.h.

Referenced by isAtEnd(), and Iterator().

◆ myContainerData

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
Node** DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::myContainerData
protected

Definition at line 555 of file ImageContainerByHashTree.h.

Referenced by Iterator().

◆ myCurrentCell

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
unsigned int DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::myCurrentCell
protected

Definition at line 553 of file ImageContainerByHashTree.h.

Referenced by isAtEnd(), and Iterator().

◆ myNode

template<typename TDomain, typename TValue, typename THashKey = typename DGtal::uint64_t>
Node* DGtal::experimental::ImageContainerByHashTree< TDomain, TValue, THashKey >::Iterator::myNode
protected

Definition at line 552 of file ImageContainerByHashTree.h.

Referenced by getKey(), Iterator(), operator!=(), operator*(), and operator==().


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