Pred< IterType, PredType > Struct Template Reference

#include <variant_filter_iterator.h>

Inheritance diagram for Pred< IterType, PredType >:

Public Member Functions

 Pred (const PredType &v)
 
virtual ~Pred ()
 
virtual PredBase * clone () const override
 
virtual PredBase::const_PredBase * const_clone () const override
 
virtual bool operator() (const IterBase *in) const override
 

Public Attributes

PredType pred_data
 

Detailed Description

template<typename IterType, typename PredType>
struct Pred< IterType, PredType >

The actual predicate is held as a template parameter here. There are two template arguments here, one for the actual type of the predicate and one for the iterator type.

Definition at line 248 of file variant_filter_iterator.h.

Constructor & Destructor Documentation

◆ Pred()

template<typename IterType, typename PredType>
Pred< IterType, PredType >::Pred ( const PredType &  v)
inline

Constructor

Definition at line 253 of file variant_filter_iterator.h.

253  :
254  pred_data (v) {}
PredType pred_data

◆ ~Pred()

template<typename IterType, typename PredType>
virtual Pred< IterType, PredType >::~Pred ( )
inlinevirtual

Destructor

Definition at line 259 of file variant_filter_iterator.h.

259 {}

Member Function Documentation

◆ clone()

template<typename IterType, typename PredType>
virtual PredBase* Pred< IterType, PredType >::clone ( ) const
inlineoverridevirtual
Returns
A copy of this object as a pointer to the base class.

Definition at line 264 of file variant_filter_iterator.h.

265  {
266 #ifdef __SUNPRO_CC
267  variant_filter_iterator::Pred<IterType,PredType> * copy =
268  new variant_filter_iterator::Pred<IterType,PredType>(pred_data);
269 #else
270  Pred<IterType,PredType> * copy =
272 #endif
273 
274  return copy;
275  }
PredType pred_data

◆ const_clone()

template<typename IterType, typename PredType>
virtual PredBase::const_PredBase* Pred< IterType, PredType >::const_clone ( ) const
inlineoverridevirtual

The redefinition of the const_clone function for the Pred class.

Important typedef for const_iterators.

Definition at line 281 of file variant_filter_iterator.h.

282  {
286  // typedef typename variant_filter_iterator<Predicate, Type, const Type &, const Type *>::template Pred<IterType, PredType> const_Pred;
287  typedef typename variant_filter_iterator<Predicate, Type const, Type const &, Type const *>::template Pred<IterType, PredType> const_Pred;
288 
289 
290  typename PredBase::const_PredBase * copy =
291  new const_Pred(pred_data);
292 
293  return copy;
294  }
PredType pred_data

◆ operator()()

template<typename IterType, typename PredType>
virtual bool Pred< IterType, PredType >::operator() ( const IterBase *  in) const
inlineoverridevirtual

Re-implementation of op()

Definition at line 302 of file variant_filter_iterator.h.

303  {
304  libmesh_assert(in);
305 
306  // Attempt downcast
307 #if defined(__SUNPRO_CC) || (defined(__GNUC__) && (__GNUC__ < 3) && !defined(__INTEL_COMPILER))
308  const variant_filter_iterator::Iter<IterType> * p =
309  libMesh::cast_ptr<const variant_filter_iterator::Iter<IterType> * >(in);
310 #else
311  const Iter<IterType> * p =
312  libMesh::cast_ptr<const Iter<IterType> *>(in);
313 #endif
314 
315  // Return result of op() for the user's predicate.
316  return pred_data(p->iter_data);
317  }
PredType pred_data

Member Data Documentation

◆ pred_data

template<typename IterType, typename PredType>
PredType Pred< IterType, PredType >::pred_data

This is the predicate passed in by the user.

Definition at line 322 of file variant_filter_iterator.h.


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