libMesh
Public Member Functions | Public Attributes | List of all members
Pred< IterType, PredType > Struct Template Reference

The actual predicate is held as a template parameter here. More...

#include <variant_filter_iterator.h>

Inheritance diagram for Pred< IterType, PredType >:
[legend]

Public Member Functions

 Pred (const PredType &v)
 Constructor. More...
 
virtual ~Pred ()
 Destructor. More...
 
virtual PredBase * clone () const libmesh_override
 
virtual PredBase::const_PredBase * const_clone () const libmesh_override
 The redefinition of the const_clone function for the Pred class. More...
 
virtual bool operator() (const IterBase *in) const libmesh_override
 Re-implementation of op() More...
 

Public Attributes

PredType pred_data
 This is the predicate passed in by the user. More...
 

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

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

Constructor.

Definition at line 253 of file variant_filter_iterator.h.

253  :
254  pred_data (v) {}
PredType pred_data
This is the predicate passed in by the user.
template<typename IterType, typename PredType>
virtual Pred< IterType, PredType >::~Pred ( )
virtual

Destructor.

Definition at line 259 of file variant_filter_iterator.h.

259 {}

Member Function Documentation

template<typename IterType, typename PredType>
virtual PredBase* Pred< IterType, PredType >::clone ( ) const
virtual
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
This is the predicate passed in by the user.
The actual predicate is held as a template parameter here.
template<typename IterType, typename PredType>
virtual PredBase::const_PredBase* Pred< IterType, PredType >::const_clone ( ) const
virtual

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
This is the predicate passed in by the user.
The actual predicate is held as a template parameter here.
template<typename IterType, typename PredType>
virtual bool Pred< IterType, PredType >::operator() ( const IterBase *  in) const
virtual

Re-implementation of op()

Definition at line 302 of file variant_filter_iterator.h.

References libMesh::libmesh_assert().

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
This is the predicate passed in by the user.
libmesh_assert(j)

Member Data Documentation

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: