Vaucanson  1.4.1
monoid_rep_base.hh
1 // monoid_rep_base.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 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_ALGEBRA_IMPLEMENTATION_MONOID_MONOID_REP_BASE_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_MONOID_REP_BASE_HH
19 
20 # include <vector>
21 # include <string>
22 
23 # include <boost/shared_ptr.hpp>
24 
25 # include <vaucanson/algebra/concept/letter.hh>
26 # include <vaucanson/misc/usual_macros.hh>
27 
28 namespace vcsn
29 {
30  namespace algebra
31  {
32  template <template <typename> class S, typename T>
33  struct MonoidRepBase
34  {
35  // The type of the monoid.
36  typedef T monoid_t;
37 
38  // The most derived type in the hierarchy.
39  typedef S<monoid_t> self_t;
40 
41  // Pointer types.
42  typedef boost::shared_ptr<self_t> pointer_t;
43 
44  // Basic structure attributes.
45  std::string empty;
46  std::string concat;
47  std::vector<std::string> maybe_epsilon;
48 
49  // Default CTOR.
50  MonoidRepBase();
51 
52  // Disambiguate the tokens w.r.t. a monoid.
53  void disambiguate(const monoid_t&, pointer_t&);
54  };
55 
56  template <template <typename> class S, typename T>
57  bool operator==(boost::shared_ptr<MonoidRepBase<S, T> >,
58  boost::shared_ptr<MonoidRepBase<S, T> >);
59 
60  } // ! algebra
61 
62 } // ! vcsn
63 
64 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
65 # include <vaucanson/algebra/implementation/monoid/monoid_rep_base.hxx>
66 # endif // VCSN_USE_INTERFACE_ONLY
67 
68 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_MONOID_REP_BASE_HH