$extrastylesheet
#include <variant_filter_iterator.h>
Public Member Functions | |
| Pred (const PredType &v) | |
| virtual | ~Pred () |
| virtual PredBase * | clone () const |
| virtual PredBase::const_PredBase * | const_clone () const |
| virtual bool | operator() (const IterBase *in) const |
Public Attributes | |
| PredType | pred_data |
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 228 of file variant_filter_iterator.h.
| virtual PredBase* Pred< IterType, PredType >::clone | ( | ) | const [inline, virtual] |
Returns a copy of this object as a pointer to the base class.
Definition at line 244 of file variant_filter_iterator.h.
{
#ifdef __SUNPRO_CC
variant_filter_iterator::Pred<IterType,PredType> *copy =
new variant_filter_iterator::Pred<IterType,PredType>(pred_data);
#else
Pred<IterType,PredType> *copy =
new Pred<IterType,PredType>(pred_data);
#endif
return copy;
}
| virtual PredBase::const_PredBase* Pred< IterType, PredType >::const_clone | ( | ) | const [inline, virtual] |
The redefinition of the const_clone function for the Pred class. Notice the strange typename syntax required. Will it compile everywhere?
Important typedef for const_iterators. Notice the weird syntax! Does it compile everywhere?
Definition at line 262 of file variant_filter_iterator.h.
{
// typedef typename variant_filter_iterator<Predicate, Type, const Type&, const Type*>::template Pred<IterType, PredType> const_Pred;
typedef typename variant_filter_iterator<Predicate, Type const, Type const &, Type const *>::template Pred<IterType, PredType> const_Pred;
typename PredBase::const_PredBase* copy =
new const_Pred(pred_data);
return copy;
}
| virtual bool Pred< IterType, PredType >::operator() | ( | const IterBase * | in | ) | const [inline, virtual] |
Re-implementation of op()
Definition at line 283 of file variant_filter_iterator.h.
References libMesh::libmesh_assert().
{
libmesh_assert(in);
// Attempt downcast
#if defined(__SUNPRO_CC) || (defined(__GNUC__) && (__GNUC__ < 3) && !defined(__INTEL_COMPILER))
const variant_filter_iterator::Iter<IterType>* p =
libMesh::cast_ptr<const variant_filter_iterator::Iter<IterType>* >(in);
#else
const Iter<IterType>* p =
libMesh::cast_ptr<const Iter<IterType>* >(in);
#endif
// Return result of op() for the user's predicate.
return pred_data(p->iter_data);
}
This is the predicate passed in by the user.
Definition at line 303 of file variant_filter_iterator.h.