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_structures.hh>
00037 # include <vaucanson/z_automaton_structures.hh>
00038 # include <vaucanson/z_max_plus_automaton_structures.hh>
00039 # include <vaucanson/z_min_plus_automaton_structures.hh>
00040 # include <vaucanson/r_automaton_structures.hh>
00041 # include <vaucanson/fmp_transducer_structures.hh>
00042 # include <vaucanson/boolean_transducer_structures.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         void create_type_tag(const Element<S, T>& aut,
00062                              xercesc::DOMDocument* doc,
00063                              xercesc::DOMElement* root);
00064 
00065         void create_label(xercesc::DOMDocument* doc,
00066                           htransition_t e, const Element<S, T>&aut,
00067                           xercesc::DOMElement* elt, bool use_label_node);
00068 
00069         void create_initial_label(xercesc::DOMDocument* doc,
00070                                   hstate_t s, const Element<S, T>& aut,
00071                                   xercesc::DOMElement* elt,
00072                                   bool use_label_node);
00073         void create_final_label(xercesc::DOMDocument* doc,
00074                                 hstate_t s, const Element<S, T>& aut,
00075                                 xercesc::DOMElement* elt,
00076                                 bool use_label_node);
00077     };
00078 
00086     template <class S, class T>
00087     struct xml_chooser : xml_chooser_base<S, T>
00088     {};
00089 
00097     template <class S, class T>
00098     struct xml_chooser<Automata<S>, T> : xml_chooser_base<Automata<S>, T>
00099     {};
00100 
00108     template <class S, class T>
00109     struct xml_chooser<Transducer<S>, T> : xml_chooser_base<Transducer<S>, T>
00110     {
00111         void create_type_tag(const Element<Transducer<S>, T>& aut,
00112                              xercesc::DOMDocument* doc,
00113                              xercesc::DOMElement* root);
00114     };
00115 
00125 # define FMPtype                                                        \
00126     Automata<                                                           \
00127       vcsn::algebra::Series<S, vcsn::algebra::FreeMonoidProduct<M1, M2> > \
00128       >, T
00129 
00130     template <class S, class T, class M1, class M2>
00131     struct xml_chooser<FMPtype> : xml_chooser_base<FMPtype>
00132     {
00133         void create_type_tag(const Element<FMPtype>& aut,
00134                              xercesc::DOMDocument* doc,
00135                              xercesc::DOMElement* root);
00136     };
00137 
00138 
00139   } // !xml
00140 
00141 } // !vcsn
00142 
00143 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00144 #  include <vaucanson/xml/xml_chooser.hxx>
00145 # endif // VCSN_USE_INTERFACE_ONLY
00146 
00147 # undef FMPtype
00148 
00149 #endif // ! VCSN_XML_XML_CHOOSER_HH

Generated on Sun Jul 29 19:35:31 2007 for Vaucanson by  doxygen 1.5.2