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

The definition of the struct used for iterating over sides. More...

#include <elem.h>

Inheritance diagram for libMesh::Elem::side_iterator:
[legend]

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = Elem *
 
using difference_type = std::ptrdiff_t
 
using pointer = Elem * *
 
using reference = Elem * &
 
typedef variant_filter_iterator< Elem::Predicate, Elem *, Elem * &, Elem * *, const Elem *, const Elem * &, const Elem * * > Iterator
 Shortcut name for the fully-qualified typename.
 

Public Member Functions

template<typename PredType , typename IterType >
 side_iterator (const IterType &d, const IterType &e, const PredType &p)
 
Elem * & operator* () const
 unary op*() forwards on to Iter::op*()
 
Elem * * 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< IterBase > data
 Ideally this private member data should have protected access.
 
std::unique_ptr< IterBase > end
 Also have a polymorphic pointer to the end object, this prevents iterating past the end.
 
std::unique_ptr< PredBase > pred
 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 struct used for iterating over sides.

Definition at line 3506 of file elem.h.

Member Typedef Documentation

◆ difference_type

using variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::difference_type = std::ptrdiff_t
inherited

Definition at line 57 of file variant_filter_iterator.h.

◆ Iterator

typedef variant_filter_iterator<Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * > variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::Iterator
inherited

Shortcut name for the fully-qualified typename.

Definition at line 65 of file variant_filter_iterator.h.

◆ iterator_category

using variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::iterator_category = std::forward_iterator_tag
inherited

Definition at line 55 of file variant_filter_iterator.h.

◆ pointer

using variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::pointer = Elem * *
inherited

Definition at line 58 of file variant_filter_iterator.h.

◆ reference

using variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::reference = Elem * &
inherited

Definition at line 59 of file variant_filter_iterator.h.

◆ value_type

using variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::value_type = Elem *
inherited

Definition at line 56 of file variant_filter_iterator.h.

Constructor & Destructor Documentation

◆ side_iterator()

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

Definition at line 3511 of file elem.h.

3513 :
Original Authors: Corwin Joy * Michael Gradman cjoy@houston.rr.com * Michael.Gradman@caminus....

Member Function Documentation

◆ equal()

bool variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::equal ( const variant_filter_iterator< Elem::Predicate, Elem * > &  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.

◆ operator*()

Elem * & variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::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 }

◆ operator++() [1/2]

Iterator & variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::operator++ ( )
inlineinherited

op++() forwards on to Iter::op++()

Definition at line 394 of file variant_filter_iterator.h.

395 {
396 ++*data;
397 this->satisfy_predicate();
398 return *this;
399 }
void satisfy_predicate()
Advances the data pointer until it reaches the end or the predicate is satisfied.

◆ operator++() [2/2]

const Iterator variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::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< Elem::Predicate, Elem *, Elem * &, Elem * *, const Elem *, const Elem * &, const Elem * * > Iterator
Shortcut name for the fully-qualified typename.

◆ operator->()

Elem * * variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::operator-> ( ) const
inlineinherited

op->()

Definition at line 386 of file variant_filter_iterator.h.

387 {
388 return &**this;
389 }

◆ satisfy_predicate()

void variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::satisfy_predicate ( )
inlineprivateinherited

Advances the data pointer until it reaches the end or the predicate is satisfied.

Definition at line 454 of file variant_filter_iterator.h.

455 {
456 while ( !data->equal(end) && !(*pred)(data) )
457 ++(*data);
458 }
std::unique_ptr< IterBase > end
Also have a polymorphic pointer to the end object, this prevents iterating past the end.
std::unique_ptr< PredBase > pred
The predicate object.

◆ swap()

void variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::swap ( Iterator lhs,
Iterator rhs 
)
inlineinherited

swap, used to implement op=

Definition at line 424 of file variant_filter_iterator.h.

425 {
426 // Swap the data pointers
427 std::swap (lhs.data, rhs.data);
428
429 // Swap the end pointers
430 std::swap (lhs.end, rhs.end);
431
432 // Also swap the predicate objects.
433 std::swap (lhs.pred, rhs.pred);
434 }

Member Data Documentation

◆ data

std::unique_ptr<IterBase> variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::data
inherited

Ideally this private member data should have protected access.

However, if we want a const_iterator to be constructable from an non-const one, templated versions of the same class (not related by inheritance) will need to know about these private members. Thus, they have public access.

Polymorphic pointer to the object. Don't confuse with the data pointer located in the Iter!

Definition at line 301 of file variant_filter_iterator.h.

◆ end

std::unique_ptr<IterBase> variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::end
inherited

Also have a polymorphic pointer to the end object, this prevents iterating past the end.

Definition at line 307 of file variant_filter_iterator.h.

◆ pred

std::unique_ptr<PredBase> variant_filter_iterator< Elem::Predicate , Elem * , Elem * & , Elem * * , const Elem * , const Elem * & , const Elem * * >::pred
inherited

The predicate object.

Must have op() capable of operating on IterBase * pointers. Therefore it has to follow the same paradigm as IterBase.

Definition at line 314 of file variant_filter_iterator.h.


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