automaton_view.hh

00001 // automaton_view.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_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH
00018 # define VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH
00019 
00020 # include <vaucanson/automata/concept/automata_base.hh>
00021 
00022 namespace vcsn {
00023 
00024   template <class T>
00025   class IdentityView
00026   {
00027     public:
00028       IdentityView();
00029       IdentityView(T&);
00030       IdentityView(const T&);
00031       IdentityView(const IdentityView&);
00032 
00033       const T& object() const;
00034       T& object();
00035 
00036       operator T&();
00037       operator const T&() const;
00038 
00039     private:
00040       T* object_;
00041       const T* const_object_;
00042   };
00043 
00044   template <typename T>
00045   struct automaton_traits< IdentityView<T> >
00046     : automaton_traits<T>
00047   {
00048   };
00049 
00050 
00051 #define AutoType(Type)                          \
00052   typename Element<S, IdentityView<T> >::Type
00053 
00054   template <class S, class T>
00055   const typename automaton_traits<T>::tag_t&
00056   op_get_tag(const AutomataBase<S>&, const IdentityView<T>&);
00057 
00058   template <class S, class T>
00059   typename automaton_traits<T>::tag_t&
00060   op_get_tag(const AutomataBase<S>&, IdentityView<T>&);
00061 
00062   template <class S, class T>
00063   const typename automaton_traits<T>::geometry_t&
00064   op_get_geometry(const AutomataBase<S>&, const IdentityView<T>&);
00065 
00066   template <class S, class T>
00067   typename automaton_traits<T>::geometry_t&
00068   op_get_geometry(const AutomataBase<S>&, IdentityView<T>&);
00069 
00070   template <class S, class T>
00071   bool
00072   op_exists(const AutomataBase<S>&, const IdentityView<T>&);
00073 
00074   template <class S, class T>
00075   typename automaton_traits<T>::states_t
00076   op_states(const AutomataBase<S>&, const IdentityView<T>&);
00077 
00078   template <class S, class T>
00079   typename automaton_traits<T>::transitions_t
00080   op_transitions(const AutomataBase<S>&, const IdentityView<T>&);
00081 
00082   template <class S, class T>
00083   typename automaton_traits<T>::initial_support_t
00084   op_initial(const AutomataBase<S>&, const IdentityView<T>&);
00085 
00086   template <class S, class T>
00087   typename automaton_traits<T>::final_support_t
00088   op_final(const AutomataBase<S>&, const IdentityView<T>&);
00089 
00090   template <class S, class T>
00091   void
00092   op_set_initial(const AutomataBase<S>&, IdentityView<T>&,
00093                  hstate_t state,
00094                  const AutoType(series_set_elt_t)& s);
00095 
00096   template <class S, class T>
00097   AutoType(series_set_elt_t)
00098   op_get_initial(const AutomataBase<S>&,
00099                  const IdentityView<T>&,
00100                  hstate_t state);
00101 
00102   template <class S, class T>
00103   void
00104   op_set_final(const AutomataBase<S>&, IdentityView<T>&,
00105                hstate_t state,
00106                const typename Element<S, T>::series_set_elt_t& s);
00107 
00108   template <class S, class T>
00109   typename Element<S, T>::series_set_elt_t
00110   op_get_final(const AutomataBase<S>&,
00111                const IdentityView<T>&,
00112                hstate_t state);
00113 
00114   template <class S, class T>
00115   void
00116   op_clear_initial(const AutomataBase<S>&, IdentityView<T>&);
00117 
00118   template <class S, class T>
00119   void
00120   op_clear_final(const AutomataBase<S>&, IdentityView<T>&);
00121 
00122   template <class S, class T>
00123   hstate_t
00124   op_add_state(const AutomataBase<S>&, IdentityView<T>&);
00125 
00126   template <class S, class T>
00127   hstate_t
00128   op_choose_state(const AutomataBase<S>&, IdentityView<T>&);
00129 
00130   template <class S, class T>
00131   htransition_t
00132   op_add_transition(const AutomataBase<S>&, IdentityView<T>&,
00133                     hstate_t from,
00134                     hstate_t to,
00135                     const typename Element<S, T>::label_t& label);
00136 
00137   template <class S, class T>
00138   htransition_t
00139   op_add_series_transition(const AutomataBase<S>&, IdentityView<T>&,
00140                            hstate_t from,
00141                            hstate_t to,
00142                            const typename Element<S, T>::series_set_elt_t&);
00143 
00144   template <class S, class T>
00145   htransition_t
00146   op_add_spontaneous(const AutomataBase<S>&, IdentityView<T>&,
00147                      hstate_t from,
00148                      hstate_t to);
00149 
00150   template <class S, class T>
00151   htransition_t
00152   op_add_letter_transition(const AutomataBase<S>&, IdentityView<T>&,
00153                            hstate_t from,
00154                            hstate_t to,
00155                            const typename Element<S, T>::letter_t&);
00156 
00157   template <class S, class T>
00158   void
00159   op_update(const AutomataBase<S>&, IdentityView<T>&,
00160             htransition_t,
00161             const AutoType(label_t)& l);
00162 
00163   template <class S, class T>
00164   void
00165   op_del_state(const AutomataBase<S>&, IdentityView<T>&,
00166                hstate_t);
00167 
00168   template <class S, class T>
00169   void
00170   op_del_transition(const AutomataBase<S>&, IdentityView<T>&,
00171                     htransition_t);
00172 
00173   template <class S, class T>
00174   bool
00175   op_has_state(const AutomataBase<S>&, const IdentityView<T>&,
00176                hstate_t);
00177 
00178   template <class S, class T>
00179   bool
00180   op_has_transition(const AutomataBase<S>&, const IdentityView<T>&,
00181                     htransition_t);
00182 
00183   template <class S, class T>
00184   hstate_t
00185   op_src_of(const AutomataBase<S>&, const IdentityView<T>&,
00186             htransition_t);
00187 
00188   template <class S, class T>
00189   hstate_t
00190   op_dst_of(const AutomataBase<S>&, const IdentityView<T>&,
00191             htransition_t);
00192 
00193   template <class S, class T>
00194   typename Element<S, T>::label_t
00195   op_label_of(const AutomataBase<S>&, const IdentityView<T>&,
00196               htransition_t);
00197 
00198   template <class S, class T>
00199   const typename Element<S, T>::series_set_elt_t
00200   op_series_of(const AutomataBase<S>&, const IdentityView<T>&,
00201                htransition_t);
00202 
00203   template <class S, class T>
00204   typename Element<S, T>::series_set_elt_value_t
00205   op_series_value_of(const AutomataBase<S>&, const IdentityView<T>&,
00206                      htransition_t);
00207 
00208 
00209   template <class S, class T>
00210   typename Element<S, T>::monoid_elt_t
00211   op_word_of(const AutomataBase<S>&, const IdentityView<T>&,
00212              htransition_t);
00213 
00214   template <class S, class T>
00215   typename Element<S, T>::monoid_elt_value_t
00216   op_word_value_of(const AutomataBase<S>&, const IdentityView<T>&,
00217                    htransition_t);
00218 
00219   template <class S, class T>
00220   typename Element<S, T>::letter_t
00221   op_letter_of(const AutomataBase<S>&, const IdentityView<T>&,
00222                htransition_t);
00223 
00224   template <class S, class T>
00225   bool
00226   op_is_spontaneous(const AutomataBase<S>&, const IdentityView<T>&,
00227                     htransition_t);
00228 
00229   // output_return_type = OutputIterator
00230   // output_type        = htransition_t
00231   // direction          = output
00232 
00234   template <class S, class T,
00235             typename OutputIterator>
00236   void op_delta(const AutomataBase<S>&, const IdentityView<T>&,
00237                 OutputIterator res,
00238                 hstate_t from,
00239                 delta_kind::transitions k);
00240 
00243   template <class S, class T,
00244             typename OutputIterator, typename L>
00245   void op_delta(const AutomataBase<S>&, const IdentityView<T>&,
00246                 OutputIterator res,
00247                 hstate_t from,
00248                 const L& query,
00249                 delta_kind::transitions k);
00250 
00253   template <class S, class T,
00254             typename OutputIterator, typename L>
00255   void op_letter_delta(const AutomataBase<S>&, const IdentityView<T>&,
00256                        OutputIterator res,
00257                        hstate_t from,
00258                        const L& letter,
00259                        delta_kind::transitions k);
00260 
00262   template <class S, class T,
00263             typename OutputIterator>
00264   void op_spontaneous_delta(const AutomataBase<S>&, const IdentityView<T>&,
00265                             OutputIterator res,
00266                             hstate_t from,
00267                             delta_kind::transitions k);
00268 
00269   // output_return_type = Container
00270   // output_type        = htransition_t
00271   // direction          = output
00272 
00275   template <class S, class T,
00276             typename Container>
00277   void op_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00278                  Container& res, hstate_t from, delta_kind::transitions k);
00279 
00282   template <class S, class T,
00283             typename Container, typename L>
00284   void op_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00285                  Container& res,
00286                  hstate_t from,
00287                  const L& query,
00288                  delta_kind::transitions k);
00289 
00292   template <class S, class T,
00293             typename Container, typename L>
00294   void op_letter_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00295                         Container& res,
00296                         hstate_t from,
00297                         const L& letter,
00298                         delta_kind::transitions k);
00299 
00301   template <class S, class T, class Container>
00302   void op_spontaneous_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00303                              Container& res,
00304                              hstate_t from,
00305                              delta_kind::transitions k);
00306 
00307   // output_return_type = OutputIterator
00308   // output_type        = hstate_t
00309   // direction    = output
00310 
00312   template<class S, class T, typename OutputIterator>
00313   void op_delta(const AutomataBase<S>&, const IdentityView<T>&,
00314                 OutputIterator res,
00315                 hstate_t from,
00316                 delta_kind::states k);
00317 
00320   template<class S, class T, typename OutputIterator, typename L>
00321   void op_delta(const AutomataBase<S>&, const IdentityView<T>&,
00322                 OutputIterator res,
00323                 hstate_t from,
00324                 const L& query,
00325                 delta_kind::states k);
00326 
00329   template<class S, class T, typename OutputIterator, typename L>
00330   void op_letter_delta(const AutomataBase<S>&, const IdentityView<T>&,
00331                        OutputIterator res,
00332                        hstate_t from,
00333                        const L& letter,
00334                        delta_kind::states k);
00335 
00337   template<class S, class T, typename OutputIterator>
00338   void op_spontaneous_delta(const AutomataBase<S>&, const IdentityView<T>&,
00339                             OutputIterator res,
00340                             hstate_t from,
00341                             delta_kind::states k);
00342 
00343   // output_return_type = Container
00344   // output_type        = hstate_t
00345   // direction    = output
00346 
00349   template<class S, class T, typename Container>
00350   void op_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00351                  Container& res, hstate_t from, delta_kind::states k);
00352 
00355   template<class S, class T, typename Container, typename L>
00356   void op_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00357                  Container& res,
00358                  hstate_t from,
00359                  const L& query,
00360                  delta_kind::states k);
00361 
00364   template<class S, class T, typename Container, typename L>
00365   void op_letter_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00366                         Container& res,
00367                         hstate_t from,
00368                         const L& letter,
00369                         delta_kind::states k);
00370 
00372   template<class S, class T, typename Container>
00373   void op_spontaneous_deltac(const AutomataBase<S>&, const IdentityView<T>&,
00374                              Container& res,
00375                              hstate_t from,
00376                              delta_kind::states k);
00377 
00378   // output_return_type = OutputIterator
00379   // output_type        = htransition_t
00380   // direction    = input
00381 
00383   template<class S, class T, typename OutputIterator>
00384   void op_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00385                  OutputIterator res,
00386                  hstate_t from,
00387                  delta_kind::transitions k);
00388 
00391   template<class S, class T, typename OutputIterator, typename L>
00392   void op_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00393                  OutputIterator res,
00394                  hstate_t from,
00395                  const L& query,
00396                  delta_kind::transitions k);
00397 
00400   template<class S, class T, typename OutputIterator, typename L>
00401   void op_letter_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00402                         OutputIterator res,
00403                         hstate_t from,
00404                         const L& letter,
00405                         delta_kind::transitions k);
00406 
00408   template<class S, class T, typename OutputIterator>
00409   void op_spontaneous_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00410                              OutputIterator res,
00411                              hstate_t from,
00412                              delta_kind::transitions k);
00413 
00414   // output_return_type = Container
00415   // output_type        = htransition_t
00416   // direction    = input
00417 
00420   template<class S, class T, typename Container>
00421   void op_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00422                   Container& res, hstate_t from, delta_kind::transitions k);
00423 
00426   template<class S, class T, typename Container, typename L>
00427   void op_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00428                   Container& res,
00429                   hstate_t from,
00430                   const L& query,
00431                   delta_kind::transitions k);
00432 
00435   template<class S, class T, typename Container, typename L>
00436   void op_letter_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00437                          Container& res,
00438                          hstate_t from,
00439                          const L& letter,
00440                          delta_kind::transitions k);
00441 
00443   template<class S, class T, typename Container>
00444   void op_spontaneous_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00445                               Container& res,
00446                               hstate_t from,
00447                               delta_kind::transitions k);
00448 
00449   // output_return_type = OutputIterator
00450   // output_type        = hstate_t
00451   // direction    = input
00452 
00454   template<class S, class T, typename OutputIterator>
00455   void op_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00456                  OutputIterator res,
00457                  hstate_t from,
00458                  delta_kind::states k);
00459 
00462   template<class S, class T, typename OutputIterator, typename L>
00463   void op_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00464                  OutputIterator res,
00465                  hstate_t from,
00466                  const L& query,
00467                  delta_kind::states k);
00468 
00471   template<class S, class T, typename OutputIterator, typename L>
00472   void op_letter_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00473                         OutputIterator res,
00474                         hstate_t from,
00475                         const L& letter,
00476                         delta_kind::states k);
00477 
00479   template<class S, class T, typename OutputIterator>
00480   void op_spontaneous_rdelta(const AutomataBase<S>&, const IdentityView<T>&,
00481                              OutputIterator res,
00482                              hstate_t from,
00483                              delta_kind::states k);
00484 
00485   // output_return_type = Container
00486   // output_type        = hstate_t
00487   // direction    = input
00488 
00491   template<class S, class T, typename Container>
00492   void op_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00493                   Container& res, hstate_t from, delta_kind::states k);
00494 
00497   template<class S, class T, typename Container, typename L>
00498   void op_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00499                   Container& res,
00500                   hstate_t from,
00501                   const L& query,
00502                   delta_kind::states k);
00503 
00506   template<class S, class T, typename Container, typename L>
00507   void op_letter_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00508                          Container& res,
00509                          hstate_t from,
00510                          const L& letter,
00511                          delta_kind::states k);
00512 
00514   template<class S, class T, typename Container>
00515   void op_spontaneous_rdeltac(const AutomataBase<S>&, const IdentityView<T>&,
00516                               Container& res,
00517                               hstate_t from,
00518                               delta_kind::states k);
00519 
00520 } // vcsn
00521 
00522 # undef AutoType
00523 
00524 
00525 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00526 # include <vaucanson/automata/implementation/automaton_view.hxx>
00527 #endif // VCSN_USE_INTERFACE_ONLY
00528 
00529 
00530 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH

Generated on Wed Jun 13 17:00:21 2007 for Vaucanson by  doxygen 1.5.1