00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HH
00018 # define VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HH
00019 
00020 # include <vaucanson/algebra/concept/semigroup_base.hh>
00021 
00022 namespace vcsn {
00023 
00024   namespace algebra {
00025 
00029     
00030 
00031 
00032 
00039     template<class Self>
00040     struct MonoidBase : SemigroupBase<Self>
00041     {
00043       template<typename T>
00044       Element<Self, T> identity(SELECTOR(T)) const;
00045 
00047       template<typename T>
00048       Element<Self, T> zero(SELECTOR(T)) const;
00049 
00050     protected:
00052       MonoidBase();
00053 
00055       MonoidBase(const MonoidBase& other);
00056     };
00057 
00058     template <class T>
00059     struct identity_as
00060     {
00061       template <class S>
00062       static
00063       Element<S, T> of(const S& s);
00064     };
00065 
00066     template <class T>
00067     struct zero_as
00068     {
00069       template <class S>
00070       static
00071       Element<S, T> of(const S& s);
00072     };
00073 
00077   } 
00078    
00082   
00083 
00084 
00085 
00086   template<class Self>
00087   struct dynamic_traits<algebra::MonoidBase<Self> >
00088     : dynamic_traits<algebra::SemigroupBase<Self> >
00089   { };
00090 
00091   template<typename S>
00092   struct virtual_types<algebra::MonoidBase<S> >
00093     : virtual_types<algebra::SemigroupBase<S> >
00094   { };
00095 
00096   
00097 
00098 
00099 
00101   template<class Self, typename T>
00102   struct MetaElement<algebra::MonoidBase<Self>, T>
00103     : MetaElement<algebra::SemigroupBase<Self>, T>
00104   {
00105   protected:
00107     MetaElement();
00108 
00110     MetaElement(const MetaElement& other);
00111   };
00112 
00116   namespace algebra {
00117 
00118     template<typename T, typename Self>
00119     T op_default(SELECTOR(algebra::MonoidBase<Self>), SELECTOR(T));
00120 
00121   } 
00122 
00123 } 
00124 
00125 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00126 #  include <vaucanson/algebra/concept/monoid_base.hxx>
00127 # endif // VCSN_USE_INTERFACE_ONLY
00128 
00129 #endif // ! VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HH