Vaucanson  1.4.1
pair_str_words.hh
1 // pair_str_words.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2004, 2005, 2007, 2008, 2010 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_PAIR_STR_WORDS_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_PAIR_STR_WORDS_HH
19 
20 // We will use std::pair<std::basic_string, std::basic_string> as a `word'
21 // implementation.
22 # include <string>
23 # include <utility>
24 
25 # include <vaucanson/algebra/concept/freemonoid_product.hh>
26 
27 namespace vcsn {
28 
29  namespace algebra {
30 
31  /*-------------------------------------------------------------.
32  | Implementation of words with std::pair and std::basic_string |
33  `-------------------------------------------------------------*/
34 
35  // FIXME: the four following functions should not use
36  // FreeMonoidProductBase. See op_rout for hints.
37  template <typename Self, typename T>
38  typename MetaElement<FreeMonoidProductBase<Self>, T>::first_monoid_elt_t
39  op_first(const FreeMonoidProductBase<Self>& s, T& v);
40 
41  template <typename Self, typename T>
42  typename MetaElement<FreeMonoidProductBase<Self>, T>::second_monoid_elt_t
43  op_second(const FreeMonoidProductBase<Self>& s, T& v);
44 
45  template <typename Self, typename T>
46  void
47  op_in_mirror(const FreeMonoidProductBase<Self>& s, T& v);
48 
49  template <typename Self, typename T, typename Ftor>
50  typename Ftor::result_type
51  op_length(const FreeMonoidProductBase<Self>&, const T& v, Ftor f);
52 
53  template<typename F, typename S,
54  typename A1, typename A2, typename A3, typename A4>
55  bool
56  op_is_atom(const algebra::FreeMonoidProduct<F, S>&,
57  const std::pair<std::basic_string<typename F::letter_t, A1, A2>,
58  std::basic_string<typename S::letter_t, A3, A4>
59  >& v);
60 
61  template <class F, class S>
62  void
63  op_in_mul(const algebra::FreeMonoidProduct<F, S>& s,
64  std::pair<std::basic_string<typename F::letter_t>,
65  std::basic_string<typename S::letter_t> >& dst,
66  const std::pair<std::basic_string<typename F::letter_t>,
67  std::basic_string<typename S::letter_t> >& src);
68 
69  template<class F, class S>
70  std::pair<std::basic_string<typename F::letter_t>,
71  std::basic_string<typename S::letter_t> >
72  op_mul(const algebra::FreeMonoidProduct<F, S>& s,
73  const std::pair<std::basic_string<typename F::letter_t>,
74  std::basic_string<typename S::letter_t> >& a,
75  const std::pair<std::basic_string<typename F::letter_t>,
76  std::basic_string<typename S::letter_t> >& b);
77 
78  template<class F, class S>
79  const std::pair<std::basic_string<typename F::letter_t>,
80  std::basic_string<typename S::letter_t> >
81  identity_value(SELECTOR2(algebra::FreeMonoidProduct<F, S>),
82  SELECTOR2(std::pair<std::basic_string<typename F::letter_t>,
83  std::basic_string<typename S::letter_t> >));
84 
85  template<class F, class S>
86  Element<algebra::FreeMonoidProduct<F, S>,
87  std::pair<std::basic_string<typename F::letter_t>,
88  std::basic_string<typename S::letter_t> > >
89  op_choose(const algebra::FreeMonoidProduct<F, S>& s,
90  SELECTOR2(std::pair<std::basic_string<typename F::letter_t>,
91  std::basic_string<typename S::letter_t> >));
92 
93  template <typename F, typename S, typename St>
94  St&
95  op_rout(const FreeMonoidProduct<F, S>& s,
96  St& st,
97  const std::pair<std::basic_string<typename F::letter_t>,
98  std::basic_string<typename S::letter_t> >& v);
99 
100  } // ! algebra
101 
102 } // ! vcsn
103 
104 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
105 # include <vaucanson/algebra/implementation/monoid/pair_str_words.hxx>
106 # endif // ! VCSN_USE_INTERFACE_ONLY
107 
108 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_PAIR_STR_WORDS_HH