xml_chooser.hh

Go to the documentation of this file.
00001 // xml_chooser.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 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 
00018 #ifndef VCSN_XML_XML_CHOOSER_HH
00019 # define VCSN_XML_XML_CHOOSER_HH
00020 
00031 # include <string>
00032 # include <sstream>
00033 # include <xercesc/dom/DOM.hpp>
00034 
00035 # include <vaucanson/design_pattern/element.hh>
00036 # include <vaucanson/boolean_automaton.hh>
00037 # include <vaucanson/z_automaton.hh>
00038 # include <vaucanson/z_max_plus_automaton.hh>
00039 # include <vaucanson/z_min_plus_automaton.hh>
00040 # include <vaucanson/r_automaton.hh>
00041 # include <vaucanson/fmp_transducer.hh>
00042 # include <vaucanson/boolean_transducer.hh>
00043 # include <vaucanson/misc/usual_macros.hh>
00044 # include <vaucanson/xml/tools.hh>
00045 
00046 
00047 namespace vcsn
00048 {
00049   namespace xml
00050   {
00058     template <class S, class T>
00059     struct xml_chooser_base
00060     {
00061         const char* choose_start_tag();
00062         void create_type_tag(const Element<S, T>&, xercesc::DOMDocument*,
00063                              xercesc::DOMElement*);
00064         void create_label(xercesc::DOMDocument*,
00065                           htransition_t, const Element<S, T>&,
00066                           xercesc::DOMElement*, bool use_label_node);
00067         void create_initial_label(xercesc::DOMDocument*,
00068                                   hstate_t, const Element<S, T>&,
00069                                   xercesc::DOMElement*, bool use_label_node);
00070         void create_final_label(xercesc::DOMDocument*,
00071                                 hstate_t, const Element<S, T>&,
00072                                 xercesc::DOMElement*, bool use_label_node);
00073     };
00074 
00082     template <class S, class T>
00083     struct xml_chooser : xml_chooser_base<S, T>
00084     {};
00085 
00093     template <class S, class T>
00094     struct xml_chooser<Automata<S>, T> : xml_chooser_base<Automata<S>, T>
00095     {};
00096 
00104     template <class S, class T>
00105     struct xml_chooser<Transducer<S>, T> : xml_chooser_base<Transducer<S>, T>
00106     {
00107         const char* choose_start_tag();
00108         void create_type_tag(const Element<Transducer<S>, T>&,
00109                              xercesc::DOMDocument*, xercesc::DOMElement*);
00110     };
00111 
00121 # define FMPtype                                                        \
00122     Automata<                                                           \
00123       vcsn::algebra::Series<S, vcsn::algebra::FreeMonoidProduct<M1, M2> > \
00124       >, T
00125 
00126     template <class S, class T, class M1, class M2>
00127     struct xml_chooser<FMPtype> : xml_chooser_base<FMPtype>
00128     {
00129         const char* choose_start_tag();
00130         void create_type_tag(const Element<FMPtype>&, xercesc::DOMDocument*,
00131                              xercesc::DOMElement*);
00132     };
00133 
00134 
00135   } // !xml
00136 
00137 } // !vcsn
00138 
00139 # ifndef VCSN_USE_INTERFACE_ONLY
00140 #  include <vaucanson/xml/xml_chooser.hxx>
00141 # endif // VCSN_USE_INTERFACE_ONLY
00142 
00143 # undef FMPtype
00144 
00145 #endif // ! VCSN_XML_XML_CHOOSER_HH

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