Vaucanson 1.4
|
00001 // support.hh: this file is part of the Vaucanson project. 00002 // 00003 // Vaucanson, a generic library for finite state machines. 00004 // 00005 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The Vaucanson Group. 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 00010 // of the License, or (at your option) any later version. 00011 // 00012 // The complete GNU General Public Licence Notice can be found as the 00013 // `COPYING' file in the root directory. 00014 // 00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file. 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 } // misc 00060 } // vcsn 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