Vaucanson  1.4.1
dot_dump.hxx
1 // dot_dump.hxx: 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 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_TOOLS_DOT_DUMP_HXX
18 # define VCSN_TOOLS_DOT_DUMP_HXX
19 
20 # include <string>
21 # include <vaucanson/tools/io.hh>
22 # include <vaucanson/tools/dot_format.hh>
23 # include <vaucanson/automata/concept/automata_base.hh>
24 # include <vaucanson/automata/concept/transducer_base.hh>
25 
26 namespace vcsn {
27 
28  namespace tools {
29 
30  template <class S, class Auto>
31  void dot_dump(const AutomataBase<S>&,
32  std::ostream& o,
33  const Auto& a,
34  const std::string& name)
35  {
36  o << automaton_saver(a, tools::string_out(), tools::dot(name));
37  }
38 
39  template <class S, class Auto>
40  void dot_dump(const TransducerBase<S>&,
41  std::ostream& o,
42  const Auto& a,
43  const std::string& name)
44  {
45  o << automaton_saver(a, tools::string_out(), tools::transducer_dot(name));
46  }
47 
48  template <typename Auto>
49  void dot_dump(std::ostream& o, const Auto& a, const std::string& name)
50  {
51  dot_dump(a.structure(), o, a, name);
52  }
53 
54  } // ! tools
55 
56 } // ! vcsn
57 
58 #endif // ! VCSN_TOOLS_DOT_DUMP_HXX