00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_BASE_HH
00018 # define VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_BASE_HH
00019
00020 # include <vaucanson/algebra/concept/alphabets_base.hh>
00021 # include <vaucanson/algebra/concept/monoid_base.hh>
00022 # include <string>
00023 # include <list>
00024
00025 namespace vcsn {
00026
00027 namespace algebra {
00028
00032
00033
00034
00035
00044 template<class Self>
00045 struct FreeMonoidProductBase
00046 : MonoidBase<Self>
00047 {
00049 typedef typename virtual_types<Self>::first_monoid_t first_monoid_t;
00050
00052 typedef typename virtual_types<Self>::second_monoid_t second_monoid_t;
00053
00054
00055 typedef undefined_type alphabet_t;
00056 typedef undefined_type letter_t;
00057
00059 first_monoid_t& first_monoid();
00060
00062 const first_monoid_t& first_monoid() const;
00063
00065 second_monoid_t& second_monoid();
00066
00068 const second_monoid_t& second_monoid() const;
00069
00070 protected:
00072 FreeMonoidProductBase();
00073
00075 FreeMonoidProductBase(const FreeMonoidProductBase& m);
00076 };
00077
00081 }
00082
00086
00087
00088
00089
00090 template<class Self>
00091 struct dynamic_traits<algebra::FreeMonoidProductBase<Self> >
00092 : dynamic_traits<algebra::MonoidBase<Self> >
00093 { };
00094
00095 template<typename S>
00096 struct virtual_types<algebra::FreeMonoidProductBase<S> >
00097 : virtual_types<algebra::MonoidBase<S> >
00098 {
00099 typedef undefined_type first_monoid_t;
00100 typedef undefined_type second_monoid_t;
00101 };
00102
00103
00104
00105
00106
00107
00109 template<class Self, typename T>
00110 struct MetaElement<algebra::FreeMonoidProductBase<Self>, T>
00111 : MetaElement<algebra::MonoidBase<Self>, T>
00112 {
00113 typedef typename virtual_types<Self>::first_monoid_t first_monoid_t;
00114 typedef typename virtual_types<Self>::second_monoid_t second_monoid_t;
00115
00116 typedef typename T::first_type first_monoid_elt_value_t;
00117 typedef typename T::second_type second_monoid_elt_value_t;
00118
00119 typedef Element<first_monoid_t, first_monoid_elt_value_t>
00120 first_monoid_elt_t;
00121 typedef Element<second_monoid_t, second_monoid_elt_value_t>
00122 second_monoid_elt_t;
00123
00125 first_monoid_elt_t& first();
00126
00128 const first_monoid_elt_t& first() const;
00129
00131 second_monoid_elt_t& second();
00132
00134 const second_monoid_elt_t& second() const;
00135
00137 void mirror();
00138
00140 template <class Ftor>
00141 typename Ftor::result_type length(Ftor f);
00142
00143 protected:
00145 MetaElement();
00146
00148 MetaElement(const MetaElement& other);
00149 };
00150
00154 }
00155
00156 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00157 # include <vaucanson/algebra/concept/freemonoid_product_base.hxx>
00158 # endif // VCSN_USE_INTERFACE_ONLY
00159
00160 #endif // ! VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_BASE_HH