Vaucanson  1.4.1
series_rep_base.hh
1 // series_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_SERIES_SERIES_REP_BASE_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_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, typename> class B, typename S, typename M>
33  struct SeriesRepBase
34  {
35  // The type of the semiring.
36  typedef S semiring_t;
37 
38  // The type of the monoid.
39  typedef M monoid_t;
40 
41  // The most derived type in the hierarchy.
42  typedef B<semiring_t, monoid_t> self_t;
43 
44  // Pointer types.
45  typedef boost::shared_ptr<self_t> pointer_t;
46 
47  // Basic structure attributes.
48  std::string open_par;
49  std::string close_par;
50  std::string plus;
51  std::string times;
52  std::string star;
53  std::string zero;
54  std::string open_weight;
55  std::string close_weight;
56  std::vector<std::string> spaces;
57  std::vector<std::string> maybe_zero;
58 
59  // Default CTOR
60  SeriesRepBase();
61 
62  // Disambiguate the tokens w.r.t. a monoid.
63  void disambiguate(const monoid_t&, pointer_t&);
64  };
65 
66  template <template <typename, typename> class B, typename S, typename M>
67  bool operator==(boost::shared_ptr<SeriesRepBase<B, S, M> >,
68  boost::shared_ptr<SeriesRepBase<B, S, M> >);
69 
70  } // ! algebra
71 
72 } // ! vcsn
73 
74 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
75 # include <vaucanson/algebra/implementation/series/series_rep_base.hxx>
76 # endif // VCSN_USE_INTERFACE_ONLY
77 
78 #endif // !VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_REP_BASE_HH