chainIterator.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: chainIterator.h,v 1.21 2005/10/23 12:02:18 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_KERNEL_CHAINITERATOR_H
00008 #define BALL_KERNEL_CHAINITERATOR_H
00009 
00010 #ifndef BALL_KERNEL_CHAIN_H
00011 # include <BALL/KERNEL/chain.h>
00012 #endif
00013 
00014 #ifndef BALL_KERNEL_ITERATOR_H
00015 # include <BALL/KERNEL/iterator.h>
00016 #endif
00017 
00018 #ifndef BALL_KERNEL_PREDICATE_H
00019 # include <BALL/KERNEL/predicate.h>
00020 #endif
00021 
00022 namespace BALL
00023 {
00029   class BALL_EXPORT ChainIteratorTraits
00030     : public CompositeIteratorTraits
00031   {
00032 
00033     public:
00034 
00035     inline ChainIteratorTraits();
00036 
00037     ChainIteratorTraits(const Composite& composite);
00038 
00039     inline ChainIteratorTraits(const ChainIteratorTraits& traits);
00040 
00041     ChainIteratorTraits& operator = (const ChainIteratorTraits& traits);
00042 
00043     void resetPredicate();
00044   };
00045 
00046   inline ChainIteratorTraits::ChainIteratorTraits()
00047     : CompositeIteratorTraits()
00048   {
00049     predicate_ = &RTTI::getDefault<KernelPredicate<Chain> >();
00050   }
00051 
00052   inline ChainIteratorTraits::ChainIteratorTraits(const Composite& composite)
00053     : CompositeIteratorTraits(composite)
00054   {
00055     predicate_ = &RTTI::getDefault<KernelPredicate<Chain> >();
00056   }
00057 
00058   inline ChainIteratorTraits::ChainIteratorTraits(const ChainIteratorTraits& traits)
00059     : CompositeIteratorTraits(traits)
00060   {
00061   }
00062 
00063   inline ChainIteratorTraits& ChainIteratorTraits::operator = (const ChainIteratorTraits& traits)
00064   {
00065     CompositeIteratorTraits::operator=(traits);
00066     return *this;
00067   }
00068 
00069   inline void ChainIteratorTraits::resetPredicate()
00070   {
00071     predicate_ = &RTTI::getDefault<KernelPredicate<Chain> >();
00072   }
00073 
00078 
00080   typedef BidirectionalIterator<Composite, Chain, Composite::CompositeIterator, ChainIteratorTraits>
00081     ChainIterator;
00082 
00084   typedef ConstBidirectionalIterator<Composite, Chain, Composite::CompositeIterator, ChainIteratorTraits>
00085     ChainConstIterator;
00086 
00088   typedef std::reverse_iterator<ChainIterator> ChainReverseIterator;
00089 
00091   typedef std::reverse_iterator<ChainConstIterator> ChainConstReverseIterator;
00093 } // namespace BALL 
00094 
00095 #endif // BALL_KERNEL_CHAINITERATOR_H
00096