00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HXX
00018 # define VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HXX
00019 
00020 # include <vaucanson/algebra/concept/monoid_base.hh>
00021 # include <vaucanson/algebra/concept/semigroup_base.hh>
00022 
00023 namespace vcsn {
00024 
00025   namespace algebra {
00026 
00027     
00028 
00029 
00030     template<class Self>
00031     template<typename T>
00032     Element<Self, T>
00033     MonoidBase<Self>::identity(SELECTOR(T)) const
00034     {
00035       return Element<Self, T>(this->self(),
00036                               identity_value(SELECT(Self), SELECT(T)));
00037     }
00038 
00039     template<class Self>
00040     template<typename T>
00041     Element<Self, T>  MonoidBase<Self>::zero(SELECTOR(T)) const
00042     {
00043       return Element<Self, T>(this->self(),
00044                               zero_value(SELECT(Self), SELECT(T)));
00045     }
00046 
00047     template <class Self>
00048     MonoidBase<Self>::MonoidBase()
00049     {}
00050 
00051     template <class Self>
00052     MonoidBase<Self>::MonoidBase(const MonoidBase& other) :
00053       SemigroupBase<Self>(other)
00054     {}
00055 
00056     template <class T>
00057     template <class S>
00058     Element<S, T>
00059     identity_as<T>::of(const S& s)
00060     {
00061       return s.identity(SELECT(T));
00062     }
00063 
00064     template <class T>
00065     template <class S>
00066     Element<S, T>
00067     zero_as<T>::of(const S& s)
00068     {
00069       return s.zero(SELECT(T));
00070     }
00071 
00072   } 
00073 
00074     
00075 
00076 
00077 
00078   template<class Self, typename T>
00079   MetaElement<algebra::MonoidBase<Self>, T>::MetaElement()
00080   {}
00081 
00082   template<class Self, typename T>
00083   MetaElement<algebra::MonoidBase<Self>, T>::MetaElement(const MetaElement& other) :
00084     MetaElement<algebra::SemigroupBase<Self>, T>(other)
00085   {}
00086 
00087   namespace algebra {
00088 
00089     template<typename T, typename Self>
00090     T
00091     op_default(SELECTOR(algebra::MonoidBase<Self>), SELECTOR(T))
00092     {
00093       
00094       return identity_value(SELECT(Self), SELECT(T));
00095     }
00096 
00097   } 
00098 
00099 } 
00100 
00101 #endif // ! VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HXX