Visual Computing Library
Loading...
Searching...
No Matches
vcl::PointerFromIndexIterator< Iterator, ElementType, ParentElement, CNST > Class Template Reference

This iterator is used to iterate over a container of pointers to elements and return the index of the element. More...

#include <vclib/mesh/iterators/components/pointer_from_index_iterator.h>

Public Types

using difference_type = ptrdiff_t
 
using value_type = VT *
 
using reference = VT *
 
using pointer = VT **
 
using iterator_category = std::random_access_iterator_tag
 

Public Member Functions

 PointerFromIndexIterator (Iterator it, PE pElem)
 Constructor for the begin iterator - ParentElement required.
 
 PointerFromIndexIterator (Iterator it)
 Constructor for the end iterator, ParentElement not required.
 
 PointerFromIndexIterator (const PointerFromIndexIterator &)=default
 
 PointerFromIndexIterator (const PointerFromIndexIterator< Iterator, ElementType, ParentElement, false > &oi)
 Constructor from a non-const iterator.
 
value_type operator* () const
 
auto operator-> () const
 
bool operator== (const PointerFromIndexIterator &oi) const
 
bool operator!= (const PointerFromIndexIterator &oi) const
 
PointerFromIndexIteratoroperator++ ()
 
PointerFromIndexIterator operator++ (int)
 
PointerFromIndexIteratoroperator-- ()
 
PointerFromIndexIterator operator-- (int)
 
PointerFromIndexIteratoroperator+= (difference_type n)
 
PointerFromIndexIteratoroperator-= (difference_type n)
 
PointerFromIndexIterator operator+ (difference_type n) const
 
PointerFromIndexIterator operator- (difference_type n) const
 
difference_type operator- (const PointerFromIndexIterator &oi) const
 
value_type operator[] (difference_type i)
 
bool operator< (const PointerFromIndexIterator &oi) const
 
bool operator> (const PointerFromIndexIterator &oi) const
 
bool operator<= (const PointerFromIndexIterator &oi) const
 
bool operator>= (const PointerFromIndexIterator &oi) const
 

Private Types

using VT = std::conditional_t< CNST, const ElementType, ElementType >
 
using PE = std::conditional_t< CNST, const ParentElement *, ParentElement * >
 

Private Attributes

Iterator mIt
 
PE parentElement = nullptr
 

Static Private Attributes

static constexpr uint ELEM_ID = ElementType::ELEMENT_ID
 

Detailed Description

template<typename Iterator, typename ElementType, typename ParentElement, bool CNST = false>
class vcl::PointerFromIndexIterator< Iterator, ElementType, ParentElement, CNST >

This iterator is used to iterate over a container of pointers to elements and return the index of the element.

Template Parameters
IteratorThe iterator type of the container of pointers to elements.

Constructor & Destructor Documentation

◆ PointerFromIndexIterator() [1/3]

template<typename Iterator , typename ElementType , typename ParentElement , bool CNST = false>
vcl::PointerFromIndexIterator< Iterator, ElementType, ParentElement, CNST >::PointerFromIndexIterator ( Iterator  it,
PE  pElem 
)
inline

Constructor for the begin iterator - ParentElement required.

Parameters
it
pElem

◆ PointerFromIndexIterator() [2/3]

template<typename Iterator , typename ElementType , typename ParentElement , bool CNST = false>
vcl::PointerFromIndexIterator< Iterator, ElementType, ParentElement, CNST >::PointerFromIndexIterator ( Iterator  it)
inline

Constructor for the end iterator, ParentElement not required.

Parameters
it

◆ PointerFromIndexIterator() [3/3]

template<typename Iterator , typename ElementType , typename ParentElement , bool CNST = false>
vcl::PointerFromIndexIterator< Iterator, ElementType, ParentElement, CNST >::PointerFromIndexIterator ( const PointerFromIndexIterator< Iterator, ElementType, ParentElement, false > &  oi)
inline

Constructor from a non-const iterator.

Parameters
oi

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