tools.hh

00001 // tools.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2005 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 
00018 #include <vaucanson/config/system.hh>
00019 
00020 #if not defined (VCSN_XML_TOOLS_HH) and                         \
00021     (not defined (VCSN_SANITY_CHECK) or defined (VCSN_USE_XML))
00022 # define VCSN_XML_TOOLS_HH
00023 
00024 # ifndef VCSN_USE_XML
00025 #  error Vaucanson XML support is disabled.
00026 # endif
00027 
00038 # include <xercesc/dom/DOM.hpp>
00039 # include <xercesc/framework/MemBufFormatTarget.hpp>
00040 # include <xercesc/util/XMLString.hpp>
00041 # include <xercesc/util/PlatformUtils.hpp>
00042 
00043 # include <vaucanson/design_pattern/element.hh>
00044 # include <vaucanson/tools/usual_macros.hh>
00045 # include <vaucanson/boolean_automaton.hh>
00046 # include <vaucanson/z_automaton.hh>
00047 # include <vaucanson/z_max_plus_automaton.hh>
00048 # include <vaucanson/z_min_plus_automaton.hh>
00049 # include <vaucanson/r_automaton.hh>
00050 # include <vaucanson/fmp_transducer.hh>
00051 # include <vaucanson/boolean_transducer.hh>
00052 
00053 # include <vaucanson/algebra/concept/monoid_base.hh>
00054 # include <vaucanson/automata/concept/transducer_base.hh>
00055 
00056 # include <vaucanson/xml/strings.hh>
00057 
00058 namespace vcsn
00059 {
00060   namespace xml
00061   {
00062     namespace tools
00063     {
00064       template <class S>
00065       const char* get_monoid_type(const S&);
00066 
00067       template <class S>
00068       const char* get_semiring_operations(const S&);
00069 
00070       template <class S, class T>
00071       const char* get_semiring_set(const S&, const T&);
00072 
00073       template <class S, class T, class U>
00074       void add_label(xercesc::DOMElement*, const Element<S, T>&, const U&);
00075 
00076       template <class M>
00077       xercesc::DOMElement* create_monoid(const M& monoid,
00078                                          xercesc::DOMDocument* doc,
00079                                          xercesc::DOMElement* elt);
00080       template <class A>
00081       void create_alphabet(const A& alphabet, xercesc::DOMDocument* doc,
00082                            xercesc::DOMElement* root);
00083       template <class A, class S>
00084       xercesc::DOMElement* create_semiring(const A& aut,
00085                                            const S& semiring,
00086                                            xercesc::DOMDocument* doc,
00087                                            xercesc::DOMElement* elt);
00088 
00089       template <class T>
00090       typename T::series_set_elt_t get_series(xercesc::DOMElement*, T&);
00091 
00092       template <class U, class V>
00093       void insert_letter(Element<vcsn::algebra::AlphabetSet<U>, V>&,
00094                          const std::string&);
00095 
00096       template <class U>
00097       void ensure_monoid_type(const xercesc::DOMElement*, const U&);
00098 
00099       template <class T, class U>
00100       void ensure_semiring_type(const xercesc::DOMElement*, const T&,
00101                                 const U&);
00102 
00103       template <class OStream>
00104       void print_document(xercesc::DOMElement*, OStream&);
00105 
00106     } // ! tools
00107 
00108   } // ! xml
00109 
00110 } // ! vcsn
00111 
00112 # define TParm                                  \
00113     template <class S, class T>
00114 # define TParmFMP                                       \
00115       template <class S, class T, class M1, class M2>
00116 # define AUTtype                                \
00117     Element<Automata<S>, T>
00118 # define TRANStype                              \
00119     Element<Transducer<S>, T>
00120 # define FMPtype                                                          \
00121     Element<                                                              \
00122       Automata<                                                           \
00123       vcsn::algebra::Series<S, vcsn::algebra::FreeMonoidProduct<M1, M2> > \
00124       >, T                                                                \
00125     >
00126 
00127 
00128 # ifndef VCSN_USE_INTERFACE_ONLY
00129 #  include <vaucanson/xml/tools.hxx>
00130 # endif // VCSN_USE_INTERFACE_ONLY
00131 
00132 #endif // ! VCSN_XML_TOOLS_HH && (! VCSN_SANITY_CHECK || VCSN_USE_XML)

Generated on Fri Jul 28 12:18:53 2006 for Vaucanson by  doxygen 1.4.6