Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AMP::Mesh::MeshIteratorBase Class Referenceabstract

A base class used to iterate over elements in a Mesh. More...

#include <MeshIterator.h>

Inheritance diagram for AMP::Mesh::MeshIteratorBase:
Inheritance graph
[legend]

Public Types

using difference_type = ptrdiff_t
 
using iterator_category = std::random_access_iterator_tag
 
using pointer = const AMP::Mesh::MeshElement *
 
using reference = const AMP::Mesh::MeshElement &
 
enum class  Type : uint8_t { Forward = 1 , Bidirectional = 2 , RandomAccess = 3 }
 Enum for the type of iterator supported. More...
 
using value_type = AMP::Mesh::MeshElement
 

Public Member Functions

virtual MeshIterator begin () const =0
 Return an iterator to the beginning.
 
virtual std::string className () const =0
 Return the class name.
 
virtual std::unique_ptr< MeshIteratorBaseclone () const =0
 Clone the iterator.
 
size_t empty () const
 Return the number of elements in the iterator.
 
MeshIteratorEnd end () const
 Return an iterator to the end (use tombstone class)
 
uint64_t getID () const
 Return a unique hash id.
 
 MeshIteratorBase (int64_t, AMP::IO::RestartManager *)
 
virtual bool operator!= (const MeshIteratorBase &rhs) const =0
 Check if two iterators are not equal.
 
bool operator!= (MeshIteratorEnd) const
 Check if two iterators are not equal.
 
const MeshElementoperator* () const
 Dereference the iterator.
 
virtual MeshIteratorBaseoperator++ ()=0
 
virtual MeshIteratorBaseoperator+= (int N)=0
 
virtual MeshIteratorBaseoperator-- ()=0
 
const MeshElementoperator-> () const
 Dereference the iterator.
 
virtual bool operator== (const MeshIteratorBase &rhs) const =0
 Check if two iterators are equal.
 
bool operator== (MeshIteratorEnd) const
 Check if two iterators are equal.
 
size_t pos () const
 Return the current position (from the beginning) in the iterator.
 
virtual void registerChildObjects (AMP::IO::RestartManager *) const =0
 
virtual void setPos (size_t)=0
 Set the position in the iterator.
 
size_t size () const
 Return the number of elements in the iterator.
 
Type type () const
 Return the iterator type.
 
virtual void writeRestart (int64_t) const =0
 
virtual ~MeshIteratorBase ()=default
 Virtual destructor.
 

Protected Member Functions

 MeshIteratorBase ()=default
 
 MeshIteratorBase (const MeshIteratorBase &)=delete
 
 MeshIteratorBase (MeshIteratorBase &&)=delete
 
MeshIteratorBaseoperator= (const MeshIteratorBase &)=delete
 
MeshIteratorBaseoperator= (MeshIteratorBase &&)=delete
 

Protected Attributes

const MeshElementd_element = nullptr
 Pointer to the current element.
 
Type d_iteratorType = Type::RandomAccess
 Type of iterator.
 
size_t d_pos = 0
 Position of the iterator.
 
size_t d_size = 0
 Size of the iterator.
 
uint32_t d_typeHash = 0
 Unique hash for the type.
 

Detailed Description

A base class used to iterate over elements in a Mesh.

This class provides routines for iterating over a set of elements. It is inherited from std::iterator. The base class provides routines for the random access iterators, but does so using the increment/decrement routines. Derived classes may (or may not) override these routines for performance optimizations.

Definition at line 40 of file MeshIterator.h.

Member Typedef Documentation

◆ difference_type

Definition at line 45 of file MeshIterator.h.

◆ iterator_category

using AMP::Mesh::MeshIteratorBase::iterator_category = std::random_access_iterator_tag

Definition at line 43 of file MeshIterator.h.

◆ pointer

Definition at line 46 of file MeshIterator.h.

◆ reference

Definition at line 47 of file MeshIterator.h.

◆ value_type

Definition at line 44 of file MeshIterator.h.

Member Enumeration Documentation

◆ Type

enum class AMP::Mesh::MeshIteratorBase::Type : uint8_t
strong

Enum for the type of iterator supported.

Enumerator
Forward 
Bidirectional 
RandomAccess 

Definition at line 52 of file MeshIterator.h.

Constructor & Destructor Documentation

◆ ~MeshIteratorBase()

virtual AMP::Mesh::MeshIteratorBase::~MeshIteratorBase ( )
virtualdefault

Virtual destructor.

◆ MeshIteratorBase() [1/4]

AMP::Mesh::MeshIteratorBase::MeshIteratorBase ( int64_t  ,
AMP::IO::RestartManager  
)

◆ MeshIteratorBase() [2/4]

AMP::Mesh::MeshIteratorBase::MeshIteratorBase ( )
protecteddefault

◆ MeshIteratorBase() [3/4]

AMP::Mesh::MeshIteratorBase::MeshIteratorBase ( const MeshIteratorBase )
protecteddelete

◆ MeshIteratorBase() [4/4]

AMP::Mesh::MeshIteratorBase::MeshIteratorBase ( MeshIteratorBase &&  )
protecteddelete

Member Function Documentation

◆ begin()

virtual MeshIterator AMP::Mesh::MeshIteratorBase::begin ( ) const
pure virtual

◆ className()

virtual std::string AMP::Mesh::MeshIteratorBase::className ( ) const
pure virtual

◆ clone()

virtual std::unique_ptr< MeshIteratorBase > AMP::Mesh::MeshIteratorBase::clone ( ) const
pure virtual

◆ empty()

size_t AMP::Mesh::MeshIteratorBase::empty ( ) const
inline

Return the number of elements in the iterator.

Definition at line 63 of file MeshIterator.h.

References d_size.

◆ end()

MeshIteratorEnd AMP::Mesh::MeshIteratorBase::end ( ) const
inline

Return an iterator to the end (use tombstone class)

Definition at line 78 of file MeshIterator.h.

◆ getID()

uint64_t AMP::Mesh::MeshIteratorBase::getID ( ) const
inline

Return a unique hash id.

Definition at line 60 of file MeshIterator.h.

References d_typeHash.

◆ operator!=() [1/2]

virtual bool AMP::Mesh::MeshIteratorBase::operator!= ( const MeshIteratorBase rhs) const
pure virtual

◆ operator!=() [2/2]

bool AMP::Mesh::MeshIteratorBase::operator!= ( MeshIteratorEnd  ) const
inline

Check if two iterators are not equal.

Definition at line 84 of file MeshIterator.h.

References d_pos, and d_size.

◆ operator*()

const MeshElement & AMP::Mesh::MeshIteratorBase::operator* ( ) const
inline

Dereference the iterator.

Definition at line 75 of file MeshIterator.h.

References d_element.

◆ operator++()

virtual MeshIteratorBase & AMP::Mesh::MeshIteratorBase::operator++ ( )
pure virtual

◆ operator+=()

virtual MeshIteratorBase & AMP::Mesh::MeshIteratorBase::operator+= ( int  N)
pure virtual

◆ operator--()

virtual MeshIteratorBase & AMP::Mesh::MeshIteratorBase::operator-- ( )
pure virtual

◆ operator->()

const MeshElement * AMP::Mesh::MeshIteratorBase::operator-> ( ) const
inline

Dereference the iterator.

Definition at line 72 of file MeshIterator.h.

References d_element.

◆ operator=() [1/2]

MeshIteratorBase & AMP::Mesh::MeshIteratorBase::operator= ( const MeshIteratorBase )
protecteddelete

◆ operator=() [2/2]

MeshIteratorBase & AMP::Mesh::MeshIteratorBase::operator= ( MeshIteratorBase &&  )
protecteddelete

◆ operator==() [1/2]

virtual bool AMP::Mesh::MeshIteratorBase::operator== ( const MeshIteratorBase rhs) const
pure virtual

◆ operator==() [2/2]

bool AMP::Mesh::MeshIteratorBase::operator== ( MeshIteratorEnd  ) const
inline

Check if two iterators are equal.

Definition at line 81 of file MeshIterator.h.

References d_pos, and d_size.

◆ pos()

size_t AMP::Mesh::MeshIteratorBase::pos ( ) const
inline

Return the current position (from the beginning) in the iterator.

Definition at line 69 of file MeshIterator.h.

References d_pos.

◆ registerChildObjects()

virtual void AMP::Mesh::MeshIteratorBase::registerChildObjects ( AMP::IO::RestartManager ) const
pure virtual

◆ setPos()

virtual void AMP::Mesh::MeshIteratorBase::setPos ( size_t  )
pure virtual

◆ size()

size_t AMP::Mesh::MeshIteratorBase::size ( ) const
inline

Return the number of elements in the iterator.

Definition at line 66 of file MeshIterator.h.

References d_size.

◆ type()

Type AMP::Mesh::MeshIteratorBase::type ( ) const
inline

Return the iterator type.

Definition at line 57 of file MeshIterator.h.

References d_iteratorType.

◆ writeRestart()

virtual void AMP::Mesh::MeshIteratorBase::writeRestart ( int64_t  ) const
pure virtual

Member Data Documentation

◆ d_element

const MeshElement* AMP::Mesh::MeshIteratorBase::d_element = nullptr
protected

Pointer to the current element.

Definition at line 137 of file MeshIterator.h.

Referenced by operator*(), and operator->().

◆ d_iteratorType

Type AMP::Mesh::MeshIteratorBase::d_iteratorType = Type::RandomAccess
protected

Type of iterator.

Definition at line 133 of file MeshIterator.h.

Referenced by type().

◆ d_pos

size_t AMP::Mesh::MeshIteratorBase::d_pos = 0
protected

Position of the iterator.

Definition at line 136 of file MeshIterator.h.

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

◆ d_size

size_t AMP::Mesh::MeshIteratorBase::d_size = 0
protected

Size of the iterator.

Definition at line 135 of file MeshIterator.h.

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

◆ d_typeHash

uint32_t AMP::Mesh::MeshIteratorBase::d_typeHash = 0
protected

Unique hash for the type.

Definition at line 134 of file MeshIterator.h.

Referenced by getID().


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:43.
Comments on this page