Vaucanson  1.4.1
letter.hh
1 // letter.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, 2006, 2008 The
6 // Vaucanson Group.
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License
10 // as published by the Free Software Foundation; either version 2
11 // of the License, or (at your option) any later version.
12 //
13 // The complete GNU General Public Licence Notice can be found as the
14 // `COPYING' file in the root directory.
15 //
16 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
17 //
18 #ifndef VCSN_ALGEBRA_CONCEPT_LETTER_HH
19 # define VCSN_ALGEBRA_CONCEPT_LETTER_HH
20 
21 # include <string>
22 # include <vector>
23 # include <utility>
24 
26 # include <vaucanson/misc/static.hh>
27 
28 namespace vcsn {
29 
30  namespace algebra {
31 
32  template <class L>
33  struct letter_traits
34  {
35  // When we do not know the type we assume false.
36  typedef misc::false_t is_char_letter;
37 
38  // Default value
39  enum
40  {
41  cardinal = misc::static_pow<2, sizeof(L) * 8>::value
42  };
43 
46 
48  // FIXME: we must add traits to monoids to handle this better
49  static std::string kind();
50  static int dim();
51 
53  typedef undefined_type first_projection_t;
54 
56  typedef undefined_type second_projection_t;
57 
60  static std::pair<bool, L> literal_to_letter(const std::string&);
61 
63  static std::string letter_to_literal(const L&);
64  };
65 
66  } // ! algebra
67 
68 } // ! vcsn
69 
70 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
71 # include <vaucanson/algebra/concept/letter.hxx>
72 # endif // ! VCSN_USE_INTERFACE_ONLY
73 
74 #endif // ! VCSN_ALGEBRA_CONCEPT_LETTER_HH