Vaucanson  1.4.1
self_iterator.hh
Go to the documentation of this file.
1 // support.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_MISC_SELF_ITERATOR_HH
18 # define VCSN_MISC_SELF_ITERATOR_HH
19 
26 # include <iterator>
27 
28 namespace vcsn
29 {
30  namespace misc
31  {
32 
35 
36  template <template <class> class C, class T>
38  {
39  public:
40  SelfIterator (const C<T>& c);
41  SelfIterator ();
42  SelfIterator (const SelfIterator& s);
43 
44  const T& operator* () const;
45 
46  const SelfIterator& operator++ ();
47  SelfIterator operator++ (int);
48 
49  bool operator!= (const SelfIterator& o) const;
50  bool operator== (const SelfIterator& o) const;
51 
52  private:
53  const C<T>* c_;
54  typename C<T>::const_iterator pos_;
55  };
56 
59  } // misc
60 } // vcsn
61 
62 
63 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
64 # include <vaucanson/misc/self_iterator.hxx>
65 # endif // VCSN_USE_INTERFACE_ONLY
66 
67 
68 #endif // ! VCSN_MISC_SELF_ITERATOR_HH