Vaucanson  1.4.1
freemonoid_product_base.hxx
1 // freemonoid_product_base.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2004, 2005, 2006, 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_CONCEPT_FREEMONOID_PRODUCT_BASE_HXX
18 # define VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_BASE_HXX
19 
20 # include <vaucanson/algebra/concept/freemonoid_product_base.hh>
21 
22 namespace vcsn {
23 
24  namespace algebra {
25 
26  /*----------------------------.
27  | FreeMonoidProductBase<Self> |
28  `----------------------------*/
29 
30  template <class Self>
31  typename FreeMonoidProductBase<Self>::first_monoid_t&
33  {
34  return this->self().first_monoid();
35  }
36 
37  template <class Self>
40  {
41  return this->self().first_monoid();
42  }
43 
44  template <class Self>
47  {
48  return this->self().second_monoid();
49  }
50 
51  template <class Self>
54  {
55  return this->self().second_monoid();
56  }
57 
58  template <class Self>
60  {}
61 
62  template <class Self>
65  MonoidBase<Self>(m)
66  {}
67 
68  } // ! algebra
69 
70  /*--------------------------------------------.
71  | MetaElement<FreeMonoidProductBase<Self>, T> |
72  `--------------------------------------------*/
73  template <class Self, typename T>
75  MetaElement<algebra::MonoidBase<Self>, T>()
76  {}
77 
78  template <class Self, typename T>
81  MetaElement<algebra::MonoidBase<Self>, T>(o)
82  {}
83 
84  template <class Self, typename T>
85  typename
88  {
89  return op_first(this->structure(), this->value());
90  }
91 
92  template <class Self, typename T>
93  const
94  typename
97  {
98  return op_first(this->structure(), this->value());
99  }
100 
101  template <class Self, typename T>
102  typename
103  MetaElement<algebra::FreeMonoidProductBase<Self>, T>::second_monoid_elt_t&
105  {
106  return op_second(this->structure(), this->value());
107  }
108 
109  template <class Self, typename T>
110  const
111  typename
112  MetaElement<algebra::FreeMonoidProductBase<Self>, T>::second_monoid_elt_t&
114  {
115  return op_second(this->structure(), this->value());
116  }
117 
118  template <class Self, typename T>
119  void
121  {
122  op_in_mirror(this->structure(), this->value());
123  }
124 
125  template <class Self, typename T>
126  template <class Ftor>
127  typename Ftor::result_type
129  {
130  return op_length(this->structure(), this->value(), f);
131  }
132 
133  namespace algebra
134  {
135  template <typename Self, typename St, typename T>
136  St&
137  op_rout(const FreeMonoidProductBase<Self>& s,
138  St& st,
139  const T& v)
140  {
141  return op_rout(s.self(), st, v);
142  }
143 
144  } // ! algebra
145 
146 } // ! vcsn
147 
148 #endif // ! VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_BASE_HXX