PLaSK library
Loading...
Searching...
No Matches
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
ValueTType to iterate over.
ReferenceTType 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

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

Definition at line 45 of file iterators.hpp.

◆ value_type

Type of objects pointed by the iterator.

Definition at line 42 of file iterators.hpp.

Constructor & Destructor Documentation

◆ ~PolymorphicForwardIteratorImpl()

Virtual destructor, do nothing.

Definition at line 54 of file iterators.hpp.

Member Function Documentation

◆ clone()

◆ dereference()

◆ equal()

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()


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