libMesh
Public Types | Public Member Functions | Public Attributes | 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. More...
 

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*() More...
 
Elem * * operator-> () const
 op->() More...
 
Iteratoroperator++ ()
 op++() forwards on to Iter::op++() More...
 
const Iterator operator++ (int)
 postfix op++(), creates a temporary! More...
 
bool equal (const variant_filter_iterator &other) const
 Forwards to the equal() function defined for the IterBase pointer. More...
 
void swap (Iterator &lhs, Iterator &rhs)
 swap, used to implement op= More...
 

Public Attributes

std::unique_ptr< IterBase > data
 Ideally this private member data should have protected access. More...
 
std::unique_ptr< IterBase > end
 Also have a polymorphic pointer to the end object, this prevents iterating past the end. More...
 
std::unique_ptr< PredBase > pred
 The predicate object. More...
 

Detailed Description

The definition of the struct used for iterating over sides.

Definition at line 3312 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 3317 of file elem.h.

3319  :
Original Authors: Corwin Joy * Michael Gradman cjoy@houston.rr.com * Michael.Gradman@caminus.com Caminus, Suite 1150, Two Allen Center, 1200 Smith Street, Houston, TX 77002 This class is an extension of variant_bidirectional_iterator to a filter_iterator similar to boost&#39;s.

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.

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

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.

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

379  {
380  return **data;
381  }
std::unique_ptr< IterBase > data
Ideally this private member data should have protected access.

◆ 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.

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

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. ...
std::unique_ptr< IterBase > data
Ideally this private member data should have protected access.

◆ 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.

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

405  {
406  Iterator oldValue(*this); // standard is to return old value
407  ++*data;
408  this->satisfy_predicate();
409  return oldValue;
410  }
void satisfy_predicate()
Advances the data pointer until it reaches the end or the predicate is satisfied. ...
std::unique_ptr< IterBase > data
Ideally this private member data should have protected access.
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  }

◆ 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.

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

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  }
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=

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: