PLaSK library

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT > Struct Template Referenceabstract

Base class for forward, polymorphic iterators implementations. More...

`#include <plask/utils/iterators.hpp>`

Inheritance diagram for plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >:
[legend]

## Public Types
typedef ValueT | value_type
| Type of objects pointed by the iterator.
typedef ReferenceT | reference
| Type to represent a reference to an object pointed by the iterator.

## Public Member Functions
virtual ReferenceT | dereference () const =0
virtual void | increment ()=0
| Iterate to next value.
virtual | ~PolymorphicForwardIteratorImpl ()
| Virtual destructor, do nothing.
virtual bool | equal (const PolymorphicForwardIteratorImpl &other) const =0
| Check if this is equal to `other`.
virtual std::unique_ptr< PolymorphicForwardIteratorImpl< ValueT, ReferenceT > > | clone () const =0
| Clone this iterator.

## Detailed Description

template<typename ValueT, typename ReferenceT = ValueT&>
struct plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >

Base class for forward, polymorphic iterators implementations.

Template Parameters

  ValueT | Type to iterate over.
  ReferenceT | Type returned by dereference operation. Note that default type is not good if dereference returns temporary object. In such case `const ValueT` can be a better choice.

Definition at line 37 of file iterators.hpp.

## Member Typedef Documentation

## ◆ reference

template<typename ValueT , typename ReferenceT = ValueT&>

typedef ReferenceT plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::reference

Type to represent a reference to an object pointed by the iterator.

Definition at line 45 of file iterators.hpp.

## ◆ value_type

template<typename ValueT , typename ReferenceT = ValueT&>

typedef ValueT plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::value_type

Type of objects pointed by the iterator.

Definition at line 42 of file iterators.hpp.

## Constructor & Destructor Documentation

## ◆ ~PolymorphicForwardIteratorImpl()

template<typename ValueT , typename ReferenceT = ValueT&>

virtual plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::~PolymorphicForwardIteratorImpl | ( |  | ) |
| inline virtual

Virtual destructor, do nothing.

Definition at line 54 of file iterators.hpp.

## Member Function Documentation

## ◆ clone()

template<typename ValueT , typename ReferenceT = ValueT&>

virtual std::unique_ptr< PolymorphicForwardIteratorImpl< ValueT, ReferenceT > > plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::clone | ( |  | ) | const
| pure virtual

Clone this iterator.

Returns
  clone of `*this`, allocated with new operator (caller is responsible for deleting it)

Implemented in plask::EmptyBoundaryImpl::IteratorImpl, plask::UnionBoundarySetImpl::IteratorImpl, plask::DiffBoundarySetImpl::IteratorImpl, plask::IntersectionBoundarySetImpl::IteratorImpl, plask::PredicateBoundaryImpl< MeshT, Predicate >::PredicateIteratorImpl, plask::ExtrudedTriangularMesh3D::ExtrudedTriangularBoundaryImpl::IteratorImpl, plask::ExtrudedTriangularMesh3D::ExtrudedTriangularWholeLayerBoundaryImpl::IteratorImpl, plask::RectangularMaskedMesh2D::BoundaryIteratorImpl< CHANGE_DIR >, plask::RectangularMaskedMesh3D::BoundaryIteratorImpl< CHANGE_DIR_SLOWER, CHANGE_DIR_FASTER >, and plask::PolymorphicForwardIteratorWrapperImpl< wrapped_iterator_type, ValueT, ReferenceT >.

## ◆ dereference()

template<typename ValueT , typename ReferenceT = ValueT&>

virtual ReferenceT plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::dereference | ( |  | ) | const
| pure virtual

Returns
  current value

Implemented in plask::EmptyBoundaryImpl::IteratorImpl, plask::UnionBoundarySetImpl::IteratorImpl, plask::DiffBoundarySetImpl::IteratorImpl, plask::IntersectionBoundarySetImpl::IteratorImpl, plask::PredicateBoundaryImpl< MeshT, Predicate >::PredicateIteratorImpl, plask::ExtrudedTriangularMesh3D::ExtrudedTriangularBoundaryImpl::IteratorImpl, plask::ExtrudedTriangularMesh3D::ExtrudedTriangularWholeLayerBoundaryImpl::IteratorImpl, plask::RectangularMaskedMesh2D::BoundaryIteratorImpl< CHANGE_DIR >, plask::RectangularMaskedMesh3D::BoundaryIteratorImpl< CHANGE_DIR_SLOWER, CHANGE_DIR_FASTER >, and plask::PolymorphicForwardIteratorWrapperImpl< wrapped_iterator_type, ValueT, ReferenceT >.

## ◆ equal()

template<typename ValueT , typename ReferenceT = ValueT&>

virtual bool plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::equal | ( | const PolymorphicForwardIteratorImpl< ValueT, ReferenceT > & | other | ) | const
| pure virtual

Check if this is equal to `other`.

Returns
  true only if this is equal to other

Implemented in plask::PolymorphicForwardIteratorWrapperImpl< wrapped_iterator_type, ValueT, ReferenceT >.

## ◆ increment()

template<typename ValueT , typename ReferenceT = ValueT&>

virtual void plask::PolymorphicForwardIteratorImpl< ValueT, ReferenceT >::increment | ( |  | ) |
| pure virtual

Iterate to next value.

Implemented in plask::EmptyBoundaryImpl::IteratorImpl, plask::UnionBoundarySetImpl::IteratorImpl, plask::DiffBoundarySetImpl::IteratorImpl, plask::IntersectionBoundarySetImpl::IteratorImpl, plask::PredicateBoundaryImpl< MeshT, Predicate >::PredicateIteratorImpl, plask::ExtrudedTriangularMesh3D::ExtrudedTriangularBoundaryImpl::IteratorImpl, plask::ExtrudedTriangularMesh3D::ExtrudedTriangularWholeLayerBoundaryImpl::IteratorImpl, plask::RectangularMaskedMesh2D::BoundaryIteratorImpl< CHANGE_DIR >, plask::RectangularMaskedMesh3D::BoundaryIteratorImpl< CHANGE_DIR_SLOWER, CHANGE_DIR_FASTER >, and plask::PolymorphicForwardIteratorWrapperImpl< wrapped_iterator_type, ValueT, ReferenceT >.

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

- plask/utils/iterators.hpp