$extrastylesheet
Pred< IterType, PredType > Struct Template Reference

#include <variant_filter_iterator.h>

List of all members.

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

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 228 of file variant_filter_iterator.h.


Constructor & Destructor Documentation

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

Constructor

Definition at line 233 of file variant_filter_iterator.h.

                             :
      pred_data (v) {}
template<typename IterType, typename PredType>
virtual Pred< IterType, PredType >::~Pred ( ) [inline, virtual]

Destructor

Definition at line 239 of file variant_filter_iterator.h.

{}

Member Function Documentation

template<typename IterType, typename PredType>
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;
    }
template<typename IterType, typename PredType>
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;
    }
template<typename IterType, typename PredType>
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);
    }

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 303 of file variant_filter_iterator.h.


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