00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::hstate_t& state);
00101
00102 template <class S, class T>
00103 void
00104 op_set_final(const AutomataBase<S>&, IdentityView<T>&,
00105 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 typename automaton_traits<T>::hstate_t
00124 op_add_state(const AutomataBase<S>&, IdentityView<T>&);
00125
00126 template <class S, class T>
00127 typename automaton_traits<T>::hstate_t
00128 op_choose_state(const AutomataBase<S>&, IdentityView<T>&);
00129
00130 template <class S, class T>
00131 typename automaton_traits<T>::htransition_t
00132 op_add_transition(const AutomataBase<S>&, IdentityView<T>&,
00133 const typename automaton_traits<T>::hstate_t& from,
00134 const typename automaton_traits<T>::hstate_t& to,
00135 const typename Element<S, T>::label_t& label);
00136
00137 template <class S, class T>
00138 typename automaton_traits<T>::htransition_t
00139 op_add_series_transition(const AutomataBase<S>&, IdentityView<T>&,
00140 const typename automaton_traits<T>::hstate_t& from,
00141 const typename automaton_traits<T>::hstate_t& to,
00142 const typename Element<S, T>::series_set_elt_t&);
00143
00144 template <class S, class T>
00145 typename automaton_traits<T>::htransition_t
00146 op_add_spontaneous(const AutomataBase<S>&, IdentityView<T>&,
00147 const typename automaton_traits<T>::hstate_t& from,
00148 const typename automaton_traits<T>::hstate_t& to);
00149
00150 template <class S, class T>
00151 typename automaton_traits<T>::htransition_t
00152 op_add_letter_transition(const AutomataBase<S>&, IdentityView<T>&,
00153 const typename automaton_traits<T>::hstate_t& from,
00154 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::hstate_t&);
00167
00168 template <class S, class T>
00169 void
00170 op_del_transition(const AutomataBase<S>&, IdentityView<T>&,
00171 const typename automaton_traits<T>::htransition_t&);
00172
00173 template <class S, class T>
00174 bool
00175 op_has_state(const AutomataBase<S>&, const IdentityView<T>&,
00176 const typename automaton_traits<T>::hstate_t&);
00177
00178 template <class S, class T>
00179 bool
00180 op_has_transition(const AutomataBase<S>&, const IdentityView<T>&,
00181 const typename automaton_traits<T>::htransition_t&);
00182
00183 template <class S, class T>
00184 typename automaton_traits<T>::hstate_t
00185 op_src_of(const AutomataBase<S>&, const IdentityView<T>&,
00186 const typename automaton_traits<T>::htransition_t&);
00187
00188 template <class S, class T>
00189 typename automaton_traits<T>::hstate_t
00190 op_dst_of(const AutomataBase<S>&, const IdentityView<T>&,
00191 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::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 const typename automaton_traits<T>::htransition_t&);
00223
00224 template <class S, class T>
00225 bool
00226 op_is_spontaneous(const AutomataBase<S>&, const IdentityView<T>&,
00227 const typename automaton_traits<T>::htransition_t&);
00228
00229 }
00230
00231 # undef AutoType
00232
00233
00234 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00235 # include <vaucanson/automata/implementation/automaton_view.hxx>
00236 #endif // VCSN_USE_INTERFACE_ONLY
00237
00238
00239 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH