00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_MISC_SELF_ITERATOR_HH
00018 # define VCSN_MISC_SELF_ITERATOR_HH
00019 
00026 # include <iterator>
00027 
00028 namespace vcsn
00029 {
00030   namespace misc
00031   {
00032 
00035 
00036     template <template <class> class C, class T>
00037     class SelfIterator
00038     {
00039     public:
00040       SelfIterator (const C<T>& c);
00041       SelfIterator ();
00042       SelfIterator (const SelfIterator& s);
00043 
00044       const T& operator* () const;
00045 
00046       const SelfIterator& operator++ ();
00047       SelfIterator operator++ (int);
00048 
00049       bool operator!= (const SelfIterator& o) const;
00050       bool operator== (const SelfIterator& o) const;
00051 
00052     private:
00053       const C<T>* c_;
00054       typename C<T>::const_iterator pos_;
00055     };
00056 
00059   } 
00060 } 
00061 
00062 
00063 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00064 #  include <vaucanson/misc/self_iterator.hxx>
00065 # endif // VCSN_USE_INTERFACE_ONLY
00066 
00067 
00068 #endif // ! VCSN_MISC_SELF_ITERATOR_HH