Vaucanson  1.4.1
vgraph_container.hh
1 // vgraph_container.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2007, 2008 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 
18 #ifndef VAUCANSON_AUTOMATA_IMPLEMENTATION_BMIG_VGRAPH_CONTAINER_HH
19 # define VAUCANSON_AUTOMATA_IMPLEMENTATION_BMIG_VGRAPH_CONTAINER_HH
20 
21 #include <iterator>
22 
23 namespace vcsn
24 {
25  namespace bmig
26  {
27  template<typename EdgesIterator, typename GraphData, typename HTransition>
28  class VGraphContainerIterator
29  {
30  public:
31  typedef EdgesIterator iterator;
32  VGraphContainerIterator(const GraphData& c, EdgesIterator i);
33  HTransition operator*() const;
34 
35  bool operator==(const VGraphContainerIterator& v) const;
36  bool operator!=(const VGraphContainerIterator& v) const;
37  VGraphContainerIterator& operator++();
38  VGraphContainerIterator operator++(int);
39 
40  private:
41  iterator it_;
42  iterator next_;
43  const GraphData& container_;
44  };
45 
46  template<typename EdgesIterator, typename GraphData, typename HTransition>
47  class VGraphContainer
48  {
49  public:
50  typedef VGraphContainerIterator<EdgesIterator, GraphData, HTransition> iterator;
51  typedef iterator const_iterator;
52 
53  VGraphContainer(const GraphData& g);
54 
55  iterator begin() const;
56  iterator end() const;
57 
58  size_t size() const;
59 
60  private:
61  const GraphData& graph_;
62  };
63  }
64 }
65 
66 # include <vaucanson/automata/implementation/bmig/vgraph_container.hxx>
67 
68 #endif // !VAUCANSON_AUTOMATA_IMPLEMENTATION_BMIG_VGRAPH_CONTAINER_HH