PDBAtomIterator.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: PDBAtomIterator.h,v 1.25 2005/10/23 12:02:17 oliver Exp $ 
00005 //
00006 
00007 #ifndef BALL_KERNEL_PDBATOMITERATOR_H
00008 #define BALL_KERNEL_PDBATOMITERATOR_H
00009 
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013 
00014 #ifndef BALL_KERNEL_PDBATOM_H
00015 # include <BALL/KERNEL/PDBAtom.h>
00016 #endif
00017 
00018 #ifndef BALL_KERNEL_ITERATOR_H
00019 # include <BALL/KERNEL/iterator.h>
00020 #endif
00021 
00022 #ifndef BALL_KERNEL_PREDICATE_H
00023 # include <BALL/KERNEL/predicate.h>
00024 #endif
00025 
00026 namespace BALL 
00027 {
00032   class BALL_EXPORT PDBAtomIteratorTraits
00033     : public CompositeIteratorTraits
00034   {
00035     public:
00036 
00037     inline PDBAtomIteratorTraits();
00038       
00039     PDBAtomIteratorTraits(const Composite& composite);
00040       
00041     inline PDBAtomIteratorTraits(const PDBAtomIteratorTraits& traits);
00042       
00043     PDBAtomIteratorTraits& operator = (const PDBAtomIteratorTraits& traits);
00044 
00045     void resetPredicate();
00046   };
00047 
00048   inline PDBAtomIteratorTraits::PDBAtomIteratorTraits()
00049     : CompositeIteratorTraits()
00050   {
00051     predicate_ = &RTTI::getDefault<KernelPredicate<PDBAtom> >();
00052   }
00053 
00054   inline PDBAtomIteratorTraits::PDBAtomIteratorTraits(const PDBAtomIteratorTraits& traits)
00055     : CompositeIteratorTraits(traits)
00056   {
00057   }
00058 
00059   inline PDBAtomIteratorTraits::PDBAtomIteratorTraits(const Composite& composite)
00060     : CompositeIteratorTraits(composite)
00061   {
00062     predicate_ = &RTTI::getDefault<KernelPredicate<PDBAtom> >();
00063   }
00064 
00065   inline PDBAtomIteratorTraits& PDBAtomIteratorTraits::operator = (const PDBAtomIteratorTraits& traits)
00066   {
00067     CompositeIteratorTraits::operator=(traits);
00068     return *this;
00069   }
00070 
00071   inline void PDBAtomIteratorTraits::resetPredicate()
00072   {
00073     predicate_ = &RTTI::getDefault<KernelPredicate<PDBAtom> >();
00074   }
00075 
00076 
00081 
00083   typedef BidirectionalIterator<Composite, PDBAtom, Composite::CompositeIterator, PDBAtomIteratorTraits>
00084     PDBAtomIterator;
00085 
00087   typedef ConstBidirectionalIterator<Composite, PDBAtom, Composite::CompositeIterator, PDBAtomIteratorTraits>
00088     PDBAtomConstIterator;
00089 
00091   typedef std::reverse_iterator<PDBAtomIterator> PDBAtomReverseIterator;
00092 
00094   typedef std::reverse_iterator<PDBAtomConstIterator> PDBAtomConstReverseIterator;
00096 } // namespace BALL
00097 
00098 #endif // BALL_KERNEL_PDBATOMITERATOR_H