Vaucanson  1.4.1
geometry.hh
1 // geometry.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2005, 2006, 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 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_GEOMETRY_HH
18 # define VCSN_AUTOMATA_IMPLEMENTATION_GEOMETRY_HH
19 
20 # include <map>
21 # include <string>
22 # include <vaucanson/automata/concept/handlers.hh>
23 
24 
25 namespace vcsn
26 {
35  template<typename HState, typename HTransition, typename Coords>
36  struct geometry
37  {
38  typedef HState hstate_t;
39  typedef HTransition htransition_t;
40  typedef Coords coords_t;
41 
42  // Store in this map state coordinates.
43  typedef std::map<hstate_t, coords_t>
44  states_geometry_map_t;
45 
46  // Store in this map label coordinates for transitions.
47  typedef std::map<htransition_t, coords_t>
48  transitions_geometry_map_t;
49 
50  // Store in this map label coordinates for initial transitions.
51  typedef std::map<hstate_t, coords_t>
52  initials_geometry_map_t;
53 
54  // Store in this map label coordinates for final transitions.
55  typedef std::map<hstate_t, coords_t>
56  finals_geometry_map_t;
57 
58  geometry();
59  explicit geometry(const geometry& obj);
60  ~geometry();
61  geometry& operator=(const geometry& obj);
62  geometry& copy_from(const geometry& obj);
63 
68  states_geometry_map_t& states();
69  const states_geometry_map_t& states() const;
70 
75  transitions_geometry_map_t& transitions();
76  const transitions_geometry_map_t& transitions() const;
77 
82  initials_geometry_map_t& initials();
83  const initials_geometry_map_t& initials() const;
84 
89  finals_geometry_map_t& finals();
90  const finals_geometry_map_t& finals() const;
91 
96  std::string& name();
97  const std::string& name() const;
98 
99 
100  private:
101  mutable states_geometry_map_t* states_;
102  mutable transitions_geometry_map_t* transitions_;
103  mutable initials_geometry_map_t* initials_;
104  mutable finals_geometry_map_t* finals_;
105  mutable std::string* name_;
106  };
107 
108 } // !vcsn
109 
110 
111 
112 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
113 # include <vaucanson/automata/implementation/geometry.hxx>
114 # endif // VCSN_USE_INTERFACE_ONLY
115 
116 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_GEOMETRY_HH