17 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HXX
18 # define VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HXX
21 # include <vaucanson/automata/implementation/automaton_view.hh>
23 #define AutoType(Type) \
24 typename Element<S, IdentityView<T> >::Type
29 IdentityView<T>::IdentityView():
35 IdentityView<T>::IdentityView(T& d):
41 IdentityView<T>::IdentityView(
const T& d):
47 IdentityView<T>::IdentityView(
const IdentityView& d):
50 assertion(d.object_ != 0 || d.const_object_ != 0);
51 const_object_ = d.const_object_ == 0 ? d.object_ : d.const_object_;
56 IdentityView<T>::object()
const
58 assertion(object_ != 0 || const_object_ != 0);
59 return const_object_ == 0 ? *object_ : *const_object_;
64 IdentityView<T>::object()
66 assertion(object_ != 0);
67 assertion(const_object_ == 0);
72 IdentityView<T>::operator T&()
74 assertion(object_ != 0);
75 assertion(const_object_ == 0);
80 IdentityView<T>::operator
const T&()
const
82 assertion(object_ != 0 || const_object_ != 0);
83 return const_object_ == 0 ? *object_ : *const_object_;
86 template <
class S,
class T>
87 const typename automaton_traits<T>::tag_t&
88 op_get_tag(
const AutomataBase<S>& s,
const IdentityView<T>& v)
93 template <
class S,
class T>
94 typename automaton_traits<T>::tag_t&
95 op_get_tag(
const AutomataBase<S>& s, IdentityView<T>& v)
100 template <
class S,
class T>
101 const typename automaton_traits<T>::geometry_t&
107 template <
class S,
class T>
108 typename automaton_traits<T>::geometry_t&
114 template <
class S,
class T>
116 op_exists(
const AutomataBase<S>& s,
const IdentityView<T>& v)
121 template <
class S,
class T>
122 typename automaton_traits<T>::states_t
123 op_states(
const AutomataBase<S>& s,
const IdentityView<T>& v)
128 template <
class S,
class T>
129 typename automaton_traits<T>::transitions_t
130 op_transitions(
const AutomataBase<S>& s,
const IdentityView<T>& v)
135 template <
class S,
class T>
136 typename automaton_traits<T>::initial_support_t
137 op_initial(
const AutomataBase<S>& s,
const IdentityView<T>& v)
142 template <
class S,
class T>
143 typename automaton_traits<T>::final_support_t
144 op_final(
const AutomataBase<S>& s,
const IdentityView<T>& v)
149 template <
class S,
class T>
152 const typename automaton_traits<T>::hstate_t& state,
153 const AutoType(series_set_elt_t)& s)
158 template <
class S,
class T>
159 AutoType(series_set_elt_t)
161 const IdentityView<T>& v,
162 const typename automaton_traits<T>::hstate_t& state)
167 template <
class S,
class T>
169 op_set_final(
const AutomataBase<S>& ss, IdentityView<T>& v,
170 const typename automaton_traits<T>::hstate_t& state,
171 const typename Element<S, T>::series_set_elt_t& s)
176 template <
class S,
class T>
177 typename Element<S, T>::series_set_elt_t
179 const IdentityView<T>& v,
180 const typename automaton_traits<T>::hstate_t& state)
185 template <
class S,
class T>
192 template <
class S,
class T>
199 template <
class S,
class T>
200 typename automaton_traits<T>::hstate_t
201 op_add_state(
const AutomataBase<S>& s, IdentityView<T>& v)
206 template <
class S,
class T>
207 typename automaton_traits<T>::hstate_t
213 template <
class S,
class T>
214 typename automaton_traits<T>::htransition_t
216 const typename automaton_traits<T>::hstate_t& from,
217 const typename automaton_traits<T>::hstate_t& to,
218 const typename Element<S, T>::label_t& label)
223 template <
class S,
class T>
224 typename automaton_traits<T>::htransition_t
227 const typename automaton_traits<T>::hstate_t& from,
228 const typename automaton_traits<T>::hstate_t& to,
229 const typename Element<S, T>::series_set_elt_t& se)
234 template <
class S,
class T>
235 typename automaton_traits<T>::htransition_t
237 const typename automaton_traits<T>::hstate_t& from,
238 const typename automaton_traits<T>::hstate_t& to)
243 template <
class S,
class T>
244 typename automaton_traits<T>::htransition_t
246 const typename automaton_traits<T>::hstate_t& from,
247 const typename automaton_traits<T>::hstate_t& to,
248 const typename Element<S, T>::letter_t& e)
253 template <
class S,
class T>
255 op_update(
const AutomataBase<S>& s, IdentityView<T>& v,
256 const typename automaton_traits<T>::htransition_t& e,
257 const AutoType(label_t)& l)
262 template <
class S,
class T>
264 op_del_state(
const AutomataBase<S>& s, IdentityView<T>& v,
265 const typename automaton_traits<T>::hstate_t& st)
270 template <
class S,
class T>
273 const typename automaton_traits<T>::htransition_t& e)
278 template <
class S,
class T>
281 const IdentityView<T>& v,
282 const typename automaton_traits<T>::hstate_t& st)
287 template <
class S,
class T>
290 const IdentityView<T>& v,
291 const typename automaton_traits<T>::htransition_t& e)
296 template <
class S,
class T>
297 typename automaton_traits<T>::hstate_t
299 const IdentityView<T>& v,
300 const typename automaton_traits<T>::htransition_t& e)
305 template <
class S,
class T>
306 typename automaton_traits<T>::hstate_t
308 const IdentityView<T>& v,
309 const typename automaton_traits<T>::htransition_t& e)
314 template <
class S,
class T>
315 typename Element<S, T>::label_t
317 const IdentityView<T>& v,
318 const typename automaton_traits<T>::htransition_t& e)
323 template <
class S,
class T>
324 const typename Element<S, T>::series_set_elt_t
326 const IdentityView<T>& v,
327 const typename automaton_traits<T>::htransition_t& e)
332 template <
class S,
class T>
333 typename Element<S, T>::series_set_elt_value_t
335 const IdentityView<T>& v,
336 const typename automaton_traits<T>::htransition_t& e)
341 template <
class S,
class T>
342 typename Element<S, T>::monoid_elt_t
344 const IdentityView<T>& v,
345 const typename automaton_traits<T>::htransition_t& e)
350 template <
class S,
class T>
351 typename Element<S, T>::monoid_elt_value_t
353 const IdentityView<T>& v,
354 const typename automaton_traits<T>::htransition_t& e)
359 template <
class S,
class T>
360 typename Element<S, T>::letter_t
362 const IdentityView<T>& v,
363 const typename automaton_traits<T>::htransition_t& e)
368 template <
class S,
class T>
371 const IdentityView<T>& v,
372 const typename automaton_traits<T>::htransition_t& e)
381 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HXX