00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_MONOID_FREE_MONOID_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_FREE_MONOID_HH
00019
00020 # include <set>
00021
00022 # include <vaucanson/algebra/concept/freemonoid_base.hh>
00023 # include <vaucanson/algebra/implementation/monoid/monoid_rep.hh>
00024 # include <vaucanson/misc/unique.hh>
00025 # include <vaucanson/misc/usual_macros.hh>
00026
00027 namespace vcsn
00028 {
00029 namespace algebra
00030 {
00034
00035
00036
00037
00039 template<typename A>
00040 struct FreeMonoid
00041 : FreeMonoidBase<FreeMonoid<A> >
00042 {
00043
00044 typedef A alphabets_elt_t;
00045 typedef MonoidRep<FreeMonoid<A> > monoid_rep_t;
00046 typedef boost::shared_ptr<monoid_rep_t> shared_monoid_rep_t;
00047
00050 FreeMonoid(const A& a);
00051
00054 FreeMonoid(const A& a, monoid_rep_t mr);
00055
00057 FreeMonoid(const FreeMonoid& w);
00058
00060 const shared_monoid_rep_t representation() const;
00061
00065 A& alphabet();
00066
00068 const A& alphabet() const;
00069
00070 public:
00073 void set_representation(monoid_rep_t mr);
00074
00075 protected:
00076 shared_monoid_rep_t rep_;
00077 A alph_;
00078 };
00079
00080 template<typename A>
00081 bool operator==(const FreeMonoid<A>& a,
00082 const FreeMonoid<A>& b);
00083
00087 }
00088
00092
00093
00094
00096 template<typename A>
00097 struct dynamic_traits<algebra::FreeMonoid<A> >
00098 : dynamic_traits<algebra::FreeMonoidBase<algebra::FreeMonoid<A> > >
00099 {
00101 static const bool ret = A::dynamic;
00102 };
00103
00104
00105
00106
00109 template<typename A, typename T>
00110 struct MetaElement<algebra::FreeMonoid<A>, T>
00111 : MetaElement<algebra::FreeMonoidBase<algebra::FreeMonoid<A> >, T>
00112 {};
00113
00117 template <class A>
00118 struct virtual_types<algebra::FreeMonoid<A> >
00119 : virtual_types<algebra::FreeMonoidBase<algebra::FreeMonoid<A> > >
00120 {
00121 typedef A alphabet_t;
00122 };
00123
00130 enum op_choose_max_word_length_t { op_choose_max_word_length = 32 };
00131
00132 }
00133
00134 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00135 # include <vaucanson/algebra/implementation/monoid/free_monoid.hxx>
00136 # endif // VCSN_USE_INTERFACE_ONLY
00137
00138 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_FREE_MONOID_HH