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

variant_filter_iterator::Iter

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

NAME

variant_filter_iterator::Iter -  

SYNOPSIS


#include <variant_filter_iterator.h>

Inherits variant_filter_iterator::IterBase.  

Public Types


typedef variant_filter_iterator< Predicate, Type const, Type const &, Type const * >::IterBase const_IterBase
 

Public Member Functions


Iter (const IterType &v)

Iter (const Iter &other)

virtual ~Iter ()

virtual IterBase * clone () const

virtual IterBase::const_IterBase * const_clone () const

virtual ReferenceType operator* () const

virtual void operator++ ()

virtual bool equal (const IterBase *other) const
 

Public Attributes


IterType iter_data
 

Detailed Description

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*>template<typename IterType> struct variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >

The actual iterator object is held as a template parameter here.

Definition at line 105 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*>::IterBase variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::IterBase::const_IterBase [inherited]

Definition at line 70 of file variant_filter_iterator.h.  

Constructor & Destructor Documentation

 

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

Definition at line 111 of file variant_filter_iterator.h.

                             :
      iter_data (v)
    {
      // std::cout << 'In Iter<IterType>::Iter(const IterType& v)' << std::endl;
    }
 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::Iter (const Iter< IterType > &other) [inline]Copy Constructor.

Definition at line 121 of file variant_filter_iterator.h.

                             :
      iter_data(other.iter_data)
    {}
 

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

Definition at line 129 of file variant_filter_iterator.h.

{}
 

Member Function Documentation

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual IterBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::clone () const [inline, virtual]Returns:

a copy of this object as a pointer to the base (non-templated) class.

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

Definition at line 135 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_data.

    {
#ifdef __SUNPRO_CC      
      variant_filter_iterator::Iter<IterType> *copy = 
        new variant_filter_iterator::Iter<IterType>(iter_data);
#else
      Iter<IterType> *copy = 
        new Iter<IterType>(iter_data);      
#endif
      
      return copy;
    }
 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual IterBase::const_IterBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::const_clone () const [inline, virtual]Returns a copy of this object as a pointer to a different type of object.

Important typedef for const_iterators. Notice the weird syntax! Does it compile everywhere?

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

Definition at line 152 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_data.

    {
      // typedef typename variant_filter_iterator<Predicate, Type, const Type&, const Type*>::template Iter<IterType> const_Iter;
      typedef typename variant_filter_iterator<Predicate, Type const, Type const &,  Type const *>::template Iter<IterType> const_Iter;

      typename IterBase::const_IterBase* copy =
        new const_Iter(iter_data);

      return copy;
    }
 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual bool variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::equal (const IterBase *other) const [inline, virtual]Use dynamic_cast to convert the base pointer passed in to the derived type. If the cast fails it means you compared two different derived classes.

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

Definition at line 188 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_data.

    {
      const Iter<IterType>* p = 
        dynamic_cast<const Iter<IterType>*>(other);      
      // Check for failed cast
      if (p == NULL)
        {
          // std::cerr << 'Dynamic cast failed in Iter::equal(...)' << std::endl;
          std::abort();
        }
      
      return (iter_data == p->iter_data);
    }
 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual ReferenceType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::operator* () const [inline, virtual]Custom interface method.

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

Definition at line 169 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_data.

    {
      return *iter_data;
    }
 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual void variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::operator++ () [inline, virtual]Custom interface method.

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

Definition at line 177 of file variant_filter_iterator.h.

References variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_data.

    {
      ++iter_data;
    }
 

Member Data Documentation

 

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> IterType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_dataThis is the iterator passed by the user.

Definition at line 205 of file variant_filter_iterator.h.

Referenced by variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::clone(), variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::const_clone(), variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::equal(), variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Pred< IterType, PredType >::operator()(), variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::operator*(), and variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::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> struct variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >
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*>::IterBase variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::IterBase::const_IterBase [inherited]
Constructor & Destructor Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::Iter (const IterType &v) [inline]Constructor
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::Iter (const Iter< IterType > &other) [inline]Copy Constructor.
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::~Iter () [inline, virtual]Destructor
Member Function Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual IterBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::clone () const [inline, virtual]Returns:
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual IterBase::const_IterBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::const_clone () const [inline, virtual]Returns a copy of this object as a pointer to a different type of object.
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual bool variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::equal (const IterBase *other) const [inline, virtual]Use dynamic_cast to convert the base pointer passed in to the derived type. If the cast fails it means you compared two different derived classes.
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual ReferenceType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::operator* () const [inline, virtual]Custom interface method.
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> virtual void variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::operator++ () [inline, virtual]Custom interface method.
Member Data Documentation
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename IterType> IterType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iter< IterType >::iter_dataThis is the iterator passed by the user.
Author

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