freemonoid_product.hh

00001 // freemonoid_product.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2004 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_HH
00018 # define VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_HH
00019 
00020 # include <string>
00021 # include <vaucanson/algebra/concept/freemonoid_product_base.hh>
00022 # include <vaucanson/misc/unique.hh>
00023 
00024 namespace vcsn {
00025 
00026   namespace algebra {
00027   
00031     /*------------------------.
00032     | FreeMonoidProduct<F, S> |
00033     `------------------------*/
00034 
00036     template<class F, class S>
00037     struct FreeMonoidProduct
00038       : FreeMonoidProductBase< FreeMonoidProduct<F, S> >
00039     {
00040       typedef F                 first_monoid_t;
00041       typedef S                 second_monoid_t;
00042 
00044       FreeMonoidProduct(const F& a, const S& b);
00045 
00047       FreeMonoidProduct(const FreeMonoidProduct& w);
00048 
00052       first_monoid_t&           first_monoid();
00053 
00054       const first_monoid_t&     first_monoid() const;
00055 
00056       second_monoid_t&          second_monoid();
00057 
00058       const second_monoid_t&    second_monoid() const;
00059 
00060     protected:
00061       first_monoid_t    first_monoid_;
00062       second_monoid_t   second_monoid_;
00063     };
00064 
00065     template<class F, class S>
00066     bool operator==(const FreeMonoidProduct<F, S>& m1,
00067                     const FreeMonoidProduct<F, S>& m2);
00068 
00071   } // algebra
00072   
00076   /*-----------------------------------------.
00077   | dynamic_traits<FreeMonoidProduct<F, S> > |
00078   `-----------------------------------------*/
00080   template<class F, class S>
00081   struct dynamic_traits<algebra::FreeMonoidProduct<F, S> >
00082     : dynamic_traits<algebra::FreeMonoidProductBase<algebra::FreeMonoidProduct<F, S> > >
00083   {
00085     static const bool
00086     ret = dynamic_traits<F>::ret or dynamic_traits<S>::ret;
00087   };
00088 
00089   /*----------------------------------------.
00090   | MetaElement<FreeMonoidProduct<F, S>, T> |
00091   `----------------------------------------*/
00094   template<class F, class S, typename T>
00095   struct MetaElement<algebra::FreeMonoidProduct<F, S>, T>
00096     : MetaElement<algebra::FreeMonoidProductBase<algebra::FreeMonoidProduct<F, S> >, T>
00097   {
00098     typedef F   first_monoid_t;
00099     typedef S   second_monoid_t;
00100   };
00101 
00104   template <class F, class S>
00105   struct virtual_types<algebra::FreeMonoidProduct<F, S> >
00106     : virtual_types<algebra::FreeMonoidProductBase<algebra::FreeMonoidProduct<F, S> > >
00107   {
00109     typedef algebra::mul_kind semigroup_kind;
00110 
00111     typedef F           first_monoid_t;
00112     typedef S           second_monoid_t;
00113   };
00114 
00115 } // vcsn
00116 
00117 # ifndef VCSN_USE_INTERFACE_ONLY
00118 #  include <vaucanson/algebra/concept/freemonoid_product.hxx>
00119 # endif // VCSN_USE_INTERFACE_ONLY
00120 
00121 
00122 #endif // ! VCSN_ALGEBRA_CONCEPT_FREEMONOID_PRODUCT_HH

Generated on Sat Jul 29 17:12:59 2006 for Vaucanson by  doxygen 1.4.6