Homepage > Man Pages > Category > Subroutines
Homepage > Man Pages > Name > V

variant_filter_iterator -

man page of variant_filter_iterator -

variant_filter_iterator -: variant_filter_iterator -

NAME
variant_filter_iterator -

SYNOPSIS

#include <variant_filter_iterator.h> Inherits iterator< std::forward_iterator_tag, Type >. Classes struct Iter struct IterBase struct Pred struct PredBase Public Types typedef variant_filter_iterator< Predicate, Type, ReferenceType, PointerType > Iterator Public Member Functions template<typename PredType , typename IterType > variant_filter_iterator (const IterType &d, const IterType &e, const PredType &p) variant_filter_iterator () variant_filter_iterator (const Iterator &rhs) template<class OtherType , class OtherReferenceType , class OtherPointerType > variant_filter_iterator (const variant_filter_iterator< Predicate, OtherType, OtherReferenceType, OtherPointerType > &rhs) virtual ~variant_filter_iterator () ReferenceType operator* () const PointerType operator-> () const Iterator & operator++ () const Iterator operator++ (int) bool equal (const variant_filter_iterator &other) const void swap (Iterator &lhs, Iterator &rhs) Iterator & operator= (const Iterator &rhs) Public Attributes IterBase * data IterBase * end PredBase * pred Private Member Functions void satisfy_predicate ()

DETAILED DESCRIPTION

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*>class variant_filter_iterator< Predicate, Type, ReferenceType, PointerType > Original Authors: Corwin Joy * Michael Gradman cjoy@houston.rr.com * Michael.Gradman@caminus.com Caminus, Suite 1150, Two Allen Center, 1200 Smith Street, Houston, TX 77002 This class is an extension of variant_bidirectional_iterator to a filter_iterator similar to boost's. The filter iterator is modeled after a forward_iterator since to go backward and forward requires the storage of both a 'begin' and 'end' iterator to avoid stepping off the end or the beginning. To reduce complexity, we only allow traversal in one direction. Author: John W. Peterson, 2004. Definition at line 43 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, ReferenceType, PointerType> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::Iterator Shortcut name for the fully- qualified typename. Definition at line 49 of file variant_filter_iterator.h.

CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<typename PredType , typename IterType > variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::variant_filter_iterator (const IterType &d, const IterType &e, const PredType &p) [inline] Templated Constructor. Allows you to construct the iterator and predicate from any types. Also advances the data pointer to the first entry which satisfies the predicate. Definition at line 334 of file variant_filter_iterator.h. : data ( new Iter<IterType>(d) ), // note: uses default IterBase copy constructor end ( new Iter<IterType>(e) ), pred ( new Pred<IterType,PredType>(p) ) { this->satisfy_predicate(); } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::variant_filter_iterator () [inline] Default Constructor. Definition at line 347 of file variant_filter_iterator.h. : data(NULL), end(NULL), pred(NULL) {} template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::variant_filter_iterator (const Iterator &rhs) [inline] Copy Constructor. Copy the internal data instead of sharing it. Definition at line 356 of file variant_filter_iterator.h. : data (rhs.data != NULL ? rhs.data->clone() : NULL), end (rhs.end != NULL ? rhs.end->clone() : NULL), pred (rhs.pred != NULL ? rhs.pred->clone() : NULL) {} template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> template<class OtherType , class OtherReferenceType , class OtherPointerType > variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::variant_filter_iterator (const variant_filter_iterator< Predicate, OtherType, OtherReferenceType, OtherPointerType > &rhs) [inline] Copy construct from another (similar) variant_filter_iterator. The Predicate is the same, but the Type, ReferenceType and PointerType are different. Example: You are iterating over a std::vector<int*> with std::vector<int*>::iterator Then, you have: Type=int* , ReferenceType=int*& , PointerType=int** On the other hand, when you iterate using std::vector<int*>::const_iterator you have: Type=int * const, ReferenceType=int * const & , PointerType=int * const * Definition at line 375 of file variant_filter_iterator.h. : data (rhs.data != NULL ? rhs.data->const_clone() : NULL), end (rhs.end != NULL ? rhs.end->const_clone() : NULL), pred (rhs.pred != NULL ? rhs.pred->const_clone() : NULL) { // std::cout << 'Called templated copy constructor for variant_filter_iterator' << std::endl; } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> virtual variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::~variant_filter_iterator () [inline, virtual] Destructor Definition at line 391 of file variant_filter_iterator.h. { delete data; data = NULL; delete end; end = NULL; delete pred; pred = NULL; }
MEMBER FUNCTION DOCUMENTATION
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> bool variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::equal (const variant_filter_iterator< Predicate, Type, ReferenceType, PointerType > &other) const [inline] forwards on the the equal function defined for the IterBase pointer. Possibly also compare the end pointers, but this is usually not important and would require an additional dynamic_cast. Definition at line 442 of file variant_filter_iterator.h. Referenced by operator==(). { return data->equal(other.data); } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> ReferenceType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::operator* () const [inline] unary op*() forwards on to Iter::op*() Definition at line 401 of file variant_filter_iterator.h. { return **data; } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> const Iterator variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::operator++ (int) [inline] postfix op++(), creates a temporary! Definition at line 428 of file variant_filter_iterator.h. { Iterator oldValue(*this); // standard is to return old value ++*data; this->satisfy_predicate(); return oldValue; } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> Iterator& variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::operator++ () [inline] op++() forwards on to Iter::op++() Definition at line 418 of file variant_filter_iterator.h. { ++*data; this->satisfy_predicate(); return (*this); } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> PointerType variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::operator-> () const [inline] op->() Definition at line 410 of file variant_filter_iterator.h. { return (&**this); } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> Iterator& variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::operator= (const Iterator &rhs) [inline] Assignment operator. Definition at line 465 of file variant_filter_iterator.h. { Iterator temp(rhs); swap(temp, *this); return *this; } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> void variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::satisfy_predicate () [inline, private] Advances the data pointer until it reaches the end or the predicate is satisfied. Definition at line 480 of file variant_filter_iterator.h. Referenced by variant_filter_iterator< MeshBase::Predicate, Elem * >::operator++(), and variant_filter_iterator< MeshBase::Predicate, Elem * >::variant_filter_iterator(). { while ( !data->equal(end) && !(*pred)(data) ) ++(*data); } template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> void variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::swap (Iterator &lhs, Iterator &rhs) [inline] swap, used to implement op= Definition at line 450 of file variant_filter_iterator.h. Referenced by variant_filter_iterator< MeshBase::Predicate, Elem * >::operator=(), and variant_filter_iterator< MeshBase::Predicate, Elem * >::swap(). { // Swap the data pointers std::swap (lhs.data, rhs.data); // Swap the end pointers std::swap (lhs.end, rhs.end); // Also swap the predicate objects. std::swap (lhs.pred, rhs.pred); }
MEMBER DATA DOCUMENTATION
template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> IterBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::data Ideally this private member data should have protected access. However, if we want a const_iterator to be constructable from an non-const one, templated versions of the same class (not related by inheritance) will need to know about these private members. Thus, they have public access. Polymorphic pointer to the object. Don't confuse with the data pointer located in the Iter! Definition at line 310 of file variant_filter_iterator.h. Referenced by variant_filter_iterator< MeshBase::Predicate, Elem * >::equal(), variant_filter_iterator< MeshBase::Predicate, Elem * >::operator*(), variant_filter_iterator< MeshBase::Predicate, Elem * >::operator++(), variant_filter_iterator< MeshBase::Predicate, Elem * >::satisfy_predicate(), variant_filter_iterator< MeshBase::Predicate, Elem * >::swap(), and variant_filter_iterator< MeshBase::Predicate, Elem * >::~variant_filter_iterator(). template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> IterBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::end Also have a polymorphic pointer to the end object, this prevents iterating past the end. Definition at line 316 of file variant_filter_iterator.h. Referenced by variant_filter_iterator< MeshBase::Predicate, Elem * >::satisfy_predicate(), variant_filter_iterator< MeshBase::Predicate, Elem * >::swap(), and variant_filter_iterator< MeshBase::Predicate, Elem * >::~variant_filter_iterator(). template<class Predicate, class Type, class ReferenceType = Type&, class PointerType = Type*> PredBase* variant_filter_iterator< Predicate, Type, ReferenceType, PointerType >::pred The predicate object. Must have op() capable of operating on IterBase* pointers. Therefore it has to follow the same paradigm as IterBase. Definition at line 323 of file variant_filter_iterator.h. Referenced by variant_filter_iterator< MeshBase::Predicate, Elem * >::swap(), and variant_filter_iterator< MeshBase::Predicate, Elem * >::~variant_filter_iterator().

AUTHOR

Generated automatically by Doxygen for libMesh from the source code. VARIANT_FILTER_ITERATOR -(3)
 
 
 

Copyright © 2011–2018 by topics-of-interest.com . All rights reserved. Hosted by all-inkl.
Contact · Imprint · Privacy

Page generated in 31.22ms.

und-verkauft.de | brieftaubenversteigerung.com | doomsdaydude.com