libMesh
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
libMesh::MeshBase::const_element_iterator Struct Reference

The definition of the const_element_iterator struct. More...

#include <mesh_base.h>

Inheritance diagram for libMesh::MeshBase::const_element_iterator:
[legend]

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = Type
 
using difference_type = std::ptrdiff_t
 
using pointer = PointerType
 
using reference = ReferenceType
 
typedef variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType > Iterator
 Shortcut name for the fully-qualified typename.
 

Public Member Functions

template<typename PredType , typename IterType >
 const_element_iterator (const IterType &d, const IterType &e, const PredType &p)
 Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.
 
 const_element_iterator (const MeshBase::element_iterator &rhs)
 The conversion-to-const ctor.
 
ReferenceType operator* () const
 unary op*() forwards on to Iter::op*()
 
PointerType operator-> () const
 op->()
 
Iteratoroperator++ ()
 op++() forwards on to Iter::op++()
 
const Iterator operator++ (int)
 postfix op++(), creates a temporary!
 
bool equal (const variant_filter_iterator &other) const
 Forwards to the equal() function defined for the IterBase pointer.
 
void swap (Iterator &lhs, Iterator &rhs)
 swap, used to implement op=
 

Public Attributes

std::unique_ptr< IterBasedata
 Ideally this private member data should have protected access.
 
std::unique_ptr< IterBaseend
 Also have a polymorphic pointer to the end object, this prevents iterating past the end.
 
std::unique_ptr< PredBasepred
 The predicate object.
 

Private Member Functions

void satisfy_predicate ()
 Advances the data pointer until it reaches the end or the predicate is satisfied.
 

Detailed Description

The definition of the const_element_iterator struct.

It is similar to the regular iterator above, but also provides an additional conversion-to-const ctor.

Definition at line 2554 of file mesh_base.h.

Member Typedef Documentation

◆ difference_type

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
using variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::difference_type = std::ptrdiff_t
inherited

Definition at line 57 of file variant_filter_iterator.h.

◆ Iterator

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
typedef variant_filter_iterator<Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::Iterator
inherited

Shortcut name for the fully-qualified typename.

Definition at line 65 of file variant_filter_iterator.h.

◆ iterator_category

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
using variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::iterator_category = std::forward_iterator_tag
inherited

Definition at line 55 of file variant_filter_iterator.h.

◆ pointer

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
using variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::pointer = PointerType
inherited

Definition at line 58 of file variant_filter_iterator.h.

◆ reference

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
using variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::reference = ReferenceType
inherited

Definition at line 59 of file variant_filter_iterator.h.

◆ value_type

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
using variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::value_type = Type
inherited

Definition at line 56 of file variant_filter_iterator.h.

Constructor & Destructor Documentation

◆ const_element_iterator() [1/2]

template<typename PredType , typename IterType >
libMesh::MeshBase::const_element_iterator::const_element_iterator ( const IterType &  d,
const IterType &  e,
const PredType &  p 
)
inline

Templated forwarding ctor – forwards to appropriate variant_filter_iterator ctor.

Definition at line 2561 of file mesh_base.h.

2563 :
2564 const_elem_filter_iter(d,e,p) {}
variant_filter_iterator< MeshBase::Predicate, Elem *const, Elem *const &, Elem *const * > const_elem_filter_iter
Definition mesh_base.h:2485

◆ const_element_iterator() [2/2]

libMesh::MeshBase::const_element_iterator::const_element_iterator ( const MeshBase::element_iterator rhs)
inline

The conversion-to-const ctor.

Takes a regular iterator and calls the appropriate variant_filter_iterator copy constructor.

Note
This one is not templated!

Definition at line 2572 of file mesh_base.h.

2572 :

Member Function Documentation

◆ equal()

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
bool variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::equal ( const variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType > &  other) const
inlineinherited

Forwards to the equal() function defined for the IterBase pointer.

Definition at line 416 of file variant_filter_iterator.h.

417 {
418 return data->equal(other.data);
419 }
std::unique_ptr< IterBase > data
Ideally this private member data should have protected access.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::data.

◆ operator*()

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
ReferenceType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::operator* ( ) const
inlineinherited

unary op*() forwards on to Iter::op*()

Definition at line 378 of file variant_filter_iterator.h.

379 {
380 return **data;
381 }

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::data.

◆ operator++() [1/2]

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
Iterator & variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::operator++ ( )
inlineinherited

◆ operator++() [2/2]

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
const Iterator variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::operator++ ( int  )
inlineinherited

postfix op++(), creates a temporary!

Definition at line 404 of file variant_filter_iterator.h.

405 {
406 Iterator oldValue(*this); // standard is to return old value
407 ++*data;
408 this->satisfy_predicate();
409 return oldValue;
410 }
variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType > Iterator
Shortcut name for the fully-qualified typename.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::data, and variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::satisfy_predicate().

◆ operator->()

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
PointerType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::operator-> ( ) const
inlineinherited

op->()

Definition at line 386 of file variant_filter_iterator.h.

387 {
388 return &**this;
389 }

◆ satisfy_predicate()

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
void variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::satisfy_predicate ( )
inlineprivateinherited

◆ swap()

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
void variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::swap ( Iterator lhs,
Iterator rhs 
)
inlineinherited

Member Data Documentation

◆ data

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
std::unique_ptr<IterBase> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::data
inherited

◆ end

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
std::unique_ptr<IterBase> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::end
inherited

◆ pred

template<class Predicate , class Type , class ReferenceType = Type &, class PointerType = Type *, class ConstType = const Type, class ConstReferenceType = const Type &, class ConstPointerType = const Type *>
std::unique_ptr<PredBase> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType, ConstType, ConstReferenceType, ConstPointerType >::pred
inherited

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