Poster of Linux kernelThe best gift for a Linux geek
variant_filter_iterator::Pred

variant_filter_iterator::Pred

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

variant_filter_iterator::Pred -  

SYNOPSIS


#include <variant_filter_iterator.h>

Inherits variant_filter_iterator::PredBase.  

Public Types


typedef variant_filter_iterator< Predicate, Type const, Type const &, Type const * >::PredBase const_PredBase
 

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<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*>template<typename IterType, typename PredType> struct variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::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 217 of file variant_filter_iterator.h.  

Member Typedef Documentation

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> typedef variant_filter_iterator<Predicate, Type const, Type const &, Type const *>::PredBase variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::PredBase::const_PredBase [inherited]

Definition at line 91 of file variant_filter_iterator.h.  

Constructor & Destructor Documentation

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::Pred (const PredType &v) [inline]Constructor

Definition at line 222 of file variant_filter_iterator.h.

                             :
      pred_data (v) {}
 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::~Pred () [inline, virtual]Destructor

Definition at line 228 of file variant_filter_iterator.h.

{}
 

Member Function Documentation

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual PredBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::clone () const [inline, virtual]Returns a copy of this object as a pointer to the base class.

Implements variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::PredBase.

Definition at line 233 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::pred_data.

    {
#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<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual PredBase::const_PredBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::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?

Implements variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::PredBase.

Definition at line 251 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::pred_data.

    {
      //      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<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual bool variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::operator() (const IterBase *in) const [inline, virtual]Re-implementation of op()

Implements variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::PredBase.

Definition at line 272 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_data, and variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::pred_data.

    {
      libmesh_assert (in != NULL);
      
      // Attempt downcast
      const Iter<IterType>* p =
        dynamic_cast<const Iter<IterType>* >(in);
      
      // Check for failure
      if ( p == NULL )
        {
          // std::cerr << 'Dynamic cast failed in Pred::op()' << std::endl;
          // std::cerr << 'typeid(IterType).name()=' << typeid(IterType).name() << std::endl;
          std::abort();
        }
      
      // Return result of op() for the user's predicate.
      return pred_data(p->iter_data);
    }
 

Member Data Documentation

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> PredType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::pred_dataThis is the predicate passed in by the user.

Definition at line 295 of file variant_filter_iterator.h.

Referenced by variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::clone(), variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::const_clone(), and variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::operator()().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Types
Public Member Functions
Public Attributes
Detailed Description
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*>template<typename IterType, typename PredType> struct variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >
Member Typedef Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> typedef variant_filter_iterator<Predicate, Type const, Type const &, Type const *>::PredBase variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::PredBase::const_PredBase [inherited]
Constructor & Destructor Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::Pred (const PredType &v) [inline]Constructor
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::~Pred () [inline, virtual]Destructor
Member Function Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual PredBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::clone () const [inline, virtual]Returns a copy of this object as a pointer to the base class.
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual PredBase::const_PredBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::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?
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> virtual bool variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::operator() (const IterBase *in) const [inline, virtual]Re-implementation of op()
Member Data Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType, typename PredType> PredType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::pred_dataThis is the predicate passed in by the user.
Author

This document was created by man2html, using the manual pages.
Time: 21:58:01 GMT, April 16, 2011