nucleotideIterator.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: nucleotideIterator.h,v 1.13 2005/10/23 12:02:19 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_KERNEL_NUCLEOTIDEITERATOR_H
00008 #define BALL_KERNEL_NUCLEOTIDEITERATOR_H
00009 
00010 #ifndef BALL_KERNEL_ITERATOR_H
00011 # include <BALL/KERNEL/iterator.h>
00012 #endif
00013 
00014 #ifndef BALL_KERNEL_PREDICATE_H
00015 # include <BALL/KERNEL/predicate.h>
00016 #endif
00017 
00018 namespace BALL 
00019 {
00020   class Nucleotide;
00021 
00025   class BALL_EXPORT NucleotideIteratorTraits
00026     : public CompositeIteratorTraits
00027   {
00028     public:
00029 
00030     NucleotideIteratorTraits()
00031       : CompositeIteratorTraits()
00032     {
00033       predicate_ = &RTTI::getDefault<KernelPredicate<Nucleotide> >();
00034     }
00035       
00036     NucleotideIteratorTraits(const Composite& composite)
00037       : CompositeIteratorTraits(composite)
00038     {
00039       predicate_ = &RTTI::getDefault<KernelPredicate<Nucleotide> >();
00040     }
00041       
00042     NucleotideIteratorTraits(const NucleotideIteratorTraits& traits, bool /* deep */ = true)
00043       : CompositeIteratorTraits(traits)
00044     {
00045     }
00046       
00047     NucleotideIteratorTraits& operator =(const NucleotideIteratorTraits& traits)
00048     {
00049       CompositeIteratorTraits::operator=(traits);
00050       return *this;
00051     }
00052 
00053     void resetPredicate()
00054     {
00055       predicate_ = &RTTI::getDefault<KernelPredicate<Nucleotide> >();
00056     }
00057   };
00058 
00059 
00060 
00061   typedef BidirectionalIterator
00062     <Composite, Nucleotide, Composite::CompositeIterator, NucleotideIteratorTraits>
00063     NucleotideIterator;
00064 
00065   typedef ConstBidirectionalIterator
00066     <Composite, Nucleotide, Composite::CompositeIterator, NucleotideIteratorTraits>
00067     NucleotideConstIterator;
00068 
00069   typedef std::reverse_iterator<NucleotideIterator> NucleotideReverseIterator;
00070 
00071   typedef std::reverse_iterator<NucleotideConstIterator> NucleotideConstReverseIterator;
00072 } // namespace BALL
00073 
00074 #endif // BALL_KERNEL_NUCLEOTIDEITERATOR_H