freemonoid_product_base.hh

00001 // freemonoid_product_base.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2004, 2005, 2006 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
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     | FreeMonoidProductBase<Self> |
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       // FIXME
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   } // algebra
00082 
00086   /*-------------------------------------------.
00087   | dynamic_traits<FreeMonoidProductBase<Self> |
00088   `-------------------------------------------*/
00089 
00090   template<class Self>
00091   struct dynamic_traits<algebra::FreeMonoidProductBase<Self> >
00092     : dynamic_traits<algebra::MonoidBase<Self> >
00093   { };
00094 
00095   /*--------------------------------------------------.
00096   | representation_traits<FreeMonoidProductBase<Self> |
00097   `--------------------------------------------------*/
00098 
00099   template<class Self>
00100   struct representation_traits<algebra::FreeMonoidProductBase<Self> >
00101   {
00102     static const std::string default_eps_eps();
00103   };
00104 
00105   /*------------------------------------------.
00106   | virtual_types<FreeMonoidProductBase<Self> |
00107   `------------------------------------------*/
00108 
00109   template<typename S>
00110   struct virtual_types<algebra::FreeMonoidProductBase<S> >
00111     : virtual_types<algebra::MonoidBase<S> >
00112   {
00113     typedef undefined_type first_monoid_t;
00114     typedef undefined_type second_monoid_t;
00115   };
00116 
00117 
00118   /*--------------------------------------------.
00119   | MetaElement<FreeMonoidProductBase<Self>, T> |
00120   `--------------------------------------------*/
00121 
00123   template<class Self, typename T>
00124   struct MetaElement<algebra::FreeMonoidProductBase<Self>, T>
00125     : MetaElement<algebra::MonoidBase<Self>, T>
00126   {
00127     typedef typename virtual_types<Self>::first_monoid_t first_monoid_t;
00128     typedef typename virtual_types<Self>::second_monoid_t second_monoid_t;
00129 
00130     typedef typename T::first_type              first_monoid_elt_value_t;
00131     typedef typename T::second_type             second_monoid_elt_value_t;
00132 
00133     typedef Element<first_monoid_t, first_monoid_elt_value_t>
00134                                                 first_monoid_elt_t;
00135     typedef Element<second_monoid_t, second_monoid_elt_value_t>
00136                                                 second_monoid_elt_t;
00137 
00139     first_monoid_elt_t& first();
00140 
00142     const first_monoid_elt_t& first() const;
00143 
00145     second_monoid_elt_t& second();
00146 
00148     const second_monoid_elt_t& second() const;
00149 
00151     void mirror();
00152 
00154     template <class Ftor>
00155     typename Ftor::result_type  length(Ftor f);
00156 
00157   protected:
00159     MetaElement();
00160 
00162     MetaElement(const MetaElement& other);
00163   };
00164 
00168 } // vcsn
00169 
00170 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00171 #  include <vaucanson/algebra/concept/freemonoid_product_base.hxx>
00172 # endif // VCSN_USE_INTERFACE_ONLY
00173 
00174 #endif // ! VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_BASE_HH

Generated on Thu Oct 9 20:22:35 2008 for Vaucanson by  doxygen 1.5.1