Vaucanson  1.4.1
automata_kind.hh
1 // automata_kind.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 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_CONCEPT_AUTOMATA_KIND_HH
18 # define VCSN_AUTOMATA_CONCEPT_AUTOMATA_KIND_HH
19 
20 # include <utility>
21 
22 namespace vcsn {
23 
24  // These names are approximate; the comments below give the details.
25  struct labels_are_letters {}; // really generators of the monoid
26  struct labels_are_atoms {}; // "letter" or monoid unit
27  struct labels_are_words {}; // really element of the monoid
28  struct labels_are_series {}; // really!
29 
30  template <class Kind,
31  class WordValue,
32  class WeightValue,
33  class SeriesValue,
34  class Letter>
35  struct LabelOf;
36 
37  template <class WordValue,
38  class WeightValue,
39  class SeriesValue,
40  class Letter>
41  struct LabelOf<labels_are_letters, WordValue, WeightValue,
42  SeriesValue, Letter>
43  {
44  typedef Letter ret;
45  };
46 
47  template <class WordValue,
48  class WeightValue,
49  class SeriesValue,
50  class Letter>
51  struct LabelOf<labels_are_atoms, WordValue, WeightValue,
52  SeriesValue, Letter>
53  {
54  typedef std::pair<WeightValue, WordValue> ret;
55  };
56 
57  template <class WordValue,
58  class WeightValue,
59  class SeriesValue,
60  class Letter>
61  struct LabelOf<labels_are_series, WordValue, WeightValue,
62  SeriesValue, Letter>
63  {
64  typedef SeriesValue ret;
65  };
66 
67  template <class WordValue,
68  class WeightValue,
69  class SeriesValue,
70  class Letter>
71  struct LabelOf<labels_are_words, WordValue, WeightValue,
72  SeriesValue, Letter>
73  {
74  typedef WordValue ret;
75  };
76 
77 } // vcsn
78 
79 #endif // ! VCSN_AUTOMATA_CONCEPT_AUTOMATA_KIND_HH