- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

# couple_letter.hh

    00001 // couple_letter.hh: this file is part of the Vaucanson project.
    00002 //
    00003 // Vaucanson, a generic library for finite state machines.
    00004 //
    00005 // Copyright (C) 2001, 2002, 2003, 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_IMPLEMENTATION_LETTER_COUPLE_LETTER_HH
    00018 # define VCSN_ALGEBRA_IMPLEMENTATION_LETTER_COUPLE_LETTER_HH
    00019
    00020 # include <climits>
    00021 # include <string>
    00022 # include <iostream>
    00023
    00024 # include <vaucanson/algebra/concept/letter.hh>
    00025 # include <vaucanson/algebra/concept/freemonoid_base.hh>
    00026
    00027 // Here are functions to manipulate pairs.
    00028
    00029 namespace vcsn
    00030 {
    00031
    00032   namespace algebra
    00033   {
    00034
    00035     template <typename U, typename V>
    00036     struct letter_traits< std::pair<U, V> >
    00037     {
    00038         enum
    00039         {
    00040           /*
    00041            * Theoretically   cardinal   should   be   the   product   of
    00042            * letter_traits<U>::cardinal and letter_traits<V>::cardinal.
    00043            * But to  avoid overflows and for
    00044            * practical reasons, it is better to consider it infinite.
    00045            *
    00046            * FIXME: Maybe doing this is not a good idea?
    00047            */
    00048           cardinal = INT_MAX
    00049         };
    00050     };
    00051
    00052   } // End of namespace algebra.
    00053 } // End of namespace vcsn.
    00054
    00055 namespace vcsn {
    00056
    00057   namespace algebra {
    00058
    00059     // Specialization for pairs.
    00060     template <typename S, typename U, typename V, typename CharContainer>
    00061     bool op_parse (const algebra::FreeMonoidBase<S>& set,
    00062                    std::basic_string< std::pair<U, V> >& v,
    00063                    const std::string& s,
    00064                    typename std::string::const_iterator& i,
    00065                    const CharContainer& escaped);
    00066   }
    00067 } //vcsn
    00068
    00069 namespace std {
    00070
    00075   template <typename U, typename V>
    00076   std::ostream& operator<< (std::ostream& o, std::pair<U, V> p);
    00077
    00079   template <typename U, typename V, class Traits, class Allocator>
    00080   std::ostream&
    00081   operator<< (std::ostream& o,
    00082               std::basic_string<std::pair<U, V>, Traits, Allocator> s);
    00083
    00085   template <typename U, typename V>
    00086   std::istream& operator>> (std::istream& i, std::pair<U, V>& p);
    00087
    00088 } // vcsn
    00089
    00090 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
    00091 #  include <vaucanson/algebra/implementation/letter/couple_letter.hxx>
    00092 # endif // VCSN_USE_INTERFACE_ONLY
    00093
    00094 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_LETTER_COUPLE_LETTER_HH