geometry.hh

00001 // geometry.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2005, 2006, 2008 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_AUTOMATA_IMPLEMENTATION_GEOMETRY_HH
00018 # define VCSN_AUTOMATA_IMPLEMENTATION_GEOMETRY_HH
00019 
00020 # include <map>
00021 # include <string>
00022 # include <vaucanson/automata/concept/handlers.hh>
00023 
00024 
00025 namespace vcsn
00026 {
00035   template<typename HState, typename HTransition, typename Coords>
00036   struct geometry
00037   {
00038     typedef HState hstate_t;
00039     typedef HTransition htransition_t;
00040     typedef Coords coords_t;
00041 
00042       // Store in this map state coordinates.
00043       typedef std::map<hstate_t, coords_t>
00044       states_geometry_map_t;
00045 
00046       // Store in this map label coordinates for transitions.
00047       typedef std::map<htransition_t, coords_t>
00048       transitions_geometry_map_t;
00049 
00050       // Store in this map label coordinates for initial transitions.
00051       typedef std::map<hstate_t, coords_t>
00052       initials_geometry_map_t;
00053 
00054       // Store in this map label coordinates for final transitions.
00055       typedef std::map<hstate_t, coords_t>
00056       finals_geometry_map_t;
00057 
00058       geometry();
00059       explicit geometry(const geometry& obj);
00060       ~geometry();
00061       geometry& operator=(const geometry& obj);
00062       geometry& copy_from(const geometry& obj);
00063 
00068       states_geometry_map_t& states();
00069       const states_geometry_map_t& states() const;
00070 
00075       transitions_geometry_map_t& transitions();
00076       const transitions_geometry_map_t& transitions() const;
00077 
00082       initials_geometry_map_t& initials();
00083       const initials_geometry_map_t& initials() const;
00084 
00089       finals_geometry_map_t& finals();
00090       const finals_geometry_map_t& finals() const;
00091 
00096       std::string& name();
00097       const std::string& name() const;
00098 
00099 
00100     private:
00101       mutable states_geometry_map_t*    states_;
00102       mutable transitions_geometry_map_t*       transitions_;
00103       mutable initials_geometry_map_t*  initials_;
00104       mutable finals_geometry_map_t*    finals_;
00105       mutable std::string*              name_;
00106   };
00107 
00108 } // !vcsn
00109 
00110 
00111 
00112 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00113 #  include <vaucanson/automata/implementation/geometry.hxx>
00114 # endif // VCSN_USE_INTERFACE_ONLY
00115 
00116 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_GEOMETRY_HH

Generated on Thu Oct 9 20:22:35 2008 for Vaucanson by  doxygen 1.5.1