Pred< IterType, PredType > Struct Template Reference
#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 |
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
| Pred< IterType, PredType >::Pred | ( | const PredType & | v | ) | [inline] |
Constructor
Definition at line 233 of file variant_filter_iterator.h.
00233 : 00234 pred_data (v) {}
Member Function Documentation
| 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.
00245 { 00246 #ifdef __SUNPRO_CC 00247 variant_filter_iterator::Pred<IterType,PredType> *copy = 00248 new variant_filter_iterator::Pred<IterType,PredType>(pred_data); 00249 #else 00250 Pred<IterType,PredType> *copy = 00251 new Pred<IterType,PredType>(pred_data); 00252 #endif 00253 00254 return copy; 00255 }
| 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.
00263 { 00267 // typedef typename variant_filter_iterator<Predicate, Type, const Type&, const Type*>::template Pred<IterType, PredType> const_Pred; 00268 typedef typename variant_filter_iterator<Predicate, Type const, Type const &, Type const *>::template Pred<IterType, PredType> const_Pred; 00269 00270 00271 typename PredBase::const_PredBase* copy = 00272 new const_Pred(pred_data); 00273 00274 return copy; 00275 }
| 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.
00284 { 00285 libmesh_assert(in); 00286 00287 // Attempt downcast 00288 #if defined(__SUNPRO_CC) || (defined(__GNUC__) && (__GNUC__ < 3) && !defined(__INTEL_COMPILER)) 00289 const variant_filter_iterator::Iter<IterType>* p = 00290 libMesh::libmesh_cast_ptr<const variant_filter_iterator::Iter<IterType>* >(in); 00291 #else 00292 const Iter<IterType>* p = 00293 libMesh::libmesh_cast_ptr<const Iter<IterType>* >(in); 00294 #endif 00295 00296 // Return result of op() for the user's predicate. 00297 return pred_data(p->iter_data); 00298 }
Member Data Documentation
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:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:49 UTC
Hosted By: