Vaucanson 1.4
pair_str_words.hh
00001 // pair_str_words.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, 2007, 2008, 2010 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_IMPLEMENTATION_MONOID_PAIR_STR_WORDS_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_PAIR_STR_WORDS_HH
00019 
00020 // We will use std::pair<std::basic_string, std::basic_string> as a `word'
00021 // implementation.
00022 # include <string>
00023 # include <utility>
00024 
00025 # include <vaucanson/algebra/concept/freemonoid_product.hh>
00026 
00027 namespace vcsn {
00028 
00029   namespace algebra {
00030 
00031     /*-------------------------------------------------------------.
00032     | Implementation of words with std::pair and std::basic_string |
00033     `-------------------------------------------------------------*/
00034 
00035     // FIXME: the four following functions should not use
00036     // FreeMonoidProductBase. See op_rout for hints.
00037     template <typename Self, typename T>
00038     typename MetaElement<FreeMonoidProductBase<Self>, T>::first_monoid_elt_t
00039     op_first(const FreeMonoidProductBase<Self>& s, T& v);
00040 
00041     template <typename Self, typename T>
00042     typename MetaElement<FreeMonoidProductBase<Self>, T>::second_monoid_elt_t
00043     op_second(const FreeMonoidProductBase<Self>& s, T& v);
00044 
00045     template <typename Self, typename T>
00046     void
00047     op_in_mirror(const FreeMonoidProductBase<Self>& s, T& v);
00048 
00049     template <typename Self, typename T, typename Ftor>
00050     typename Ftor::result_type
00051     op_length(const FreeMonoidProductBase<Self>&, const T& v, Ftor f);
00052 
00053     template<typename F, typename S,
00054              typename A1, typename A2, typename A3, typename A4>
00055     bool
00056     op_is_atom(const algebra::FreeMonoidProduct<F, S>&,
00057                const std::pair<std::basic_string<typename F::letter_t, A1, A2>,
00058                                std::basic_string<typename S::letter_t, A3, A4>
00059                                >& v);
00060 
00061     template <class F, class S>
00062     void
00063     op_in_mul(const algebra::FreeMonoidProduct<F, S>& s,
00064               std::pair<std::basic_string<typename F::letter_t>,
00065                         std::basic_string<typename S::letter_t> >& dst,
00066               const std::pair<std::basic_string<typename F::letter_t>,
00067                               std::basic_string<typename S::letter_t> >& src);
00068 
00069     template<class F, class S>
00070     std::pair<std::basic_string<typename F::letter_t>,
00071               std::basic_string<typename S::letter_t> >
00072     op_mul(const algebra::FreeMonoidProduct<F, S>& s,
00073            const std::pair<std::basic_string<typename F::letter_t>,
00074                            std::basic_string<typename S::letter_t> >& a,
00075            const std::pair<std::basic_string<typename F::letter_t>,
00076                            std::basic_string<typename S::letter_t> >& b);
00077 
00078     template<class F, class S>
00079     const std::pair<std::basic_string<typename F::letter_t>,
00080                     std::basic_string<typename S::letter_t> >
00081     identity_value(SELECTOR2(algebra::FreeMonoidProduct<F, S>),
00082                    SELECTOR2(std::pair<std::basic_string<typename F::letter_t>,
00083                                    std::basic_string<typename S::letter_t> >));
00084 
00085     template<class F, class S>
00086     Element<algebra::FreeMonoidProduct<F, S>,
00087             std::pair<std::basic_string<typename F::letter_t>,
00088                       std::basic_string<typename S::letter_t> > >
00089     op_choose(const algebra::FreeMonoidProduct<F, S>& s,
00090               SELECTOR2(std::pair<std::basic_string<typename F::letter_t>,
00091                                   std::basic_string<typename S::letter_t> >));
00092 
00093     template <typename F, typename S, typename St>
00094     St&
00095     op_rout(const FreeMonoidProduct<F, S>& s,
00096             St& st,
00097             const std::pair<std::basic_string<typename F::letter_t>,
00098                             std::basic_string<typename S::letter_t> >& v);
00099 
00100   } // ! algebra
00101 
00102 } // ! vcsn
00103 
00104 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00105 #  include <vaucanson/algebra/implementation/monoid/pair_str_words.hxx>
00106 # endif // ! VCSN_USE_INTERFACE_ONLY
00107 
00108 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_PAIR_STR_WORDS_HH