Vaucanson  1.4.1
automaton_view.hh
1 // automaton_view.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH
18 # define VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH
19 
20 # include <vaucanson/automata/concept/automata_base.hh>
21 
22 namespace vcsn {
23 
24  template <class T>
25  class IdentityView
26  {
27  public:
28  IdentityView();
29  IdentityView(T&);
30  IdentityView(const T&);
31  IdentityView(const IdentityView&);
32 
33  const T& object() const;
34  T& object();
35 
36  operator T&();
37  operator const T&() const;
38 
39  private:
40  T* object_;
41  const T* const_object_;
42  };
43 
44  template <typename T>
45  struct automaton_traits< IdentityView<T> >
46  : automaton_traits<T>
47  {
48  };
49 
50 
51 #define AutoType(Type) \
52  typename Element<S, IdentityView<T> >::Type
53 
54  template <class S, class T>
55  const typename automaton_traits<T>::tag_t&
56  op_get_tag(const AutomataBase<S>&, const IdentityView<T>&);
57 
58  template <class S, class T>
59  typename automaton_traits<T>::tag_t&
60  op_get_tag(const AutomataBase<S>&, IdentityView<T>&);
61 
62  template <class S, class T>
63  const typename automaton_traits<T>::geometry_t&
64  op_get_geometry(const AutomataBase<S>&, const IdentityView<T>&);
65 
66  template <class S, class T>
67  typename automaton_traits<T>::geometry_t&
68  op_get_geometry(const AutomataBase<S>&, IdentityView<T>&);
69 
70  template <class S, class T>
71  bool
72  op_exists(const AutomataBase<S>&, const IdentityView<T>&);
73 
74  template <class S, class T>
75  typename automaton_traits<T>::states_t
76  op_states(const AutomataBase<S>&, const IdentityView<T>&);
77 
78  template <class S, class T>
79  typename automaton_traits<T>::transitions_t
80  op_transitions(const AutomataBase<S>&, const IdentityView<T>&);
81 
82  template <class S, class T>
83  typename automaton_traits<T>::initial_support_t
84  op_initial(const AutomataBase<S>&, const IdentityView<T>&);
85 
86  template <class S, class T>
87  typename automaton_traits<T>::final_support_t
88  op_final(const AutomataBase<S>&, const IdentityView<T>&);
89 
90  template <class S, class T>
91  void
92  op_set_initial(const AutomataBase<S>&, IdentityView<T>&,
93  const typename automaton_traits<T>::hstate_t& state,
94  const AutoType(series_set_elt_t)& s);
95 
96  template <class S, class T>
97  AutoType(series_set_elt_t)
98  op_get_initial(const AutomataBase<S>&,
99  const IdentityView<T>&,
100  const typename automaton_traits<T>::hstate_t& state);
101 
102  template <class S, class T>
103  void
104  op_set_final(const AutomataBase<S>&, IdentityView<T>&,
105  const typename automaton_traits<T>::hstate_t& state,
106  const typename Element<S, T>::series_set_elt_t& s);
107 
108  template <class S, class T>
109  typename Element<S, T>::series_set_elt_t
110  op_get_final(const AutomataBase<S>&,
111  const IdentityView<T>&,
112  const typename automaton_traits<T>::hstate_t& state);
113 
114  template <class S, class T>
115  void
116  op_clear_initial(const AutomataBase<S>&, IdentityView<T>&);
117 
118  template <class S, class T>
119  void
120  op_clear_final(const AutomataBase<S>&, IdentityView<T>&);
121 
122  template <class S, class T>
123  typename automaton_traits<T>::hstate_t
124  op_add_state(const AutomataBase<S>&, IdentityView<T>&);
125 
126  template <class S, class T>
127  typename automaton_traits<T>::hstate_t
128  op_choose_state(const AutomataBase<S>&, IdentityView<T>&);
129 
130  template <class S, class T>
131  typename automaton_traits<T>::htransition_t
132  op_add_transition(const AutomataBase<S>&, IdentityView<T>&,
133  const typename automaton_traits<T>::hstate_t& from,
134  const typename automaton_traits<T>::hstate_t& to,
135  const typename Element<S, T>::label_t& label);
136 
137  template <class S, class T>
138  typename automaton_traits<T>::htransition_t
139  op_add_series_transition(const AutomataBase<S>&, IdentityView<T>&,
140  const typename automaton_traits<T>::hstate_t& from,
141  const typename automaton_traits<T>::hstate_t& to,
142  const typename Element<S, T>::series_set_elt_t&);
143 
144  template <class S, class T>
145  typename automaton_traits<T>::htransition_t
146  op_add_spontaneous(const AutomataBase<S>&, IdentityView<T>&,
147  const typename automaton_traits<T>::hstate_t& from,
148  const typename automaton_traits<T>::hstate_t& to);
149 
150  template <class S, class T>
151  typename automaton_traits<T>::htransition_t
152  op_add_letter_transition(const AutomataBase<S>&, IdentityView<T>&,
153  const typename automaton_traits<T>::hstate_t& from,
154  const typename automaton_traits<T>::hstate_t& to,
155  const typename Element<S, T>::letter_t&);
156 
157  template <class S, class T>
158  void
159  op_update(const AutomataBase<S>&, IdentityView<T>&,
160  const typename automaton_traits<T>::htransition_t&,
161  const AutoType(label_t)& l);
162 
163  template <class S, class T>
164  void
165  op_del_state(const AutomataBase<S>&, IdentityView<T>&,
166  const typename automaton_traits<T>::hstate_t&);
167 
168  template <class S, class T>
169  void
170  op_del_transition(const AutomataBase<S>&, IdentityView<T>&,
171  const typename automaton_traits<T>::htransition_t&);
172 
173  template <class S, class T>
174  bool
175  op_has_state(const AutomataBase<S>&, const IdentityView<T>&,
176  const typename automaton_traits<T>::hstate_t&);
177 
178  template <class S, class T>
179  bool
180  op_has_transition(const AutomataBase<S>&, const IdentityView<T>&,
181  const typename automaton_traits<T>::htransition_t&);
182 
183  template <class S, class T>
184  typename automaton_traits<T>::hstate_t
185  op_src_of(const AutomataBase<S>&, const IdentityView<T>&,
186  const typename automaton_traits<T>::htransition_t&);
187 
188  template <class S, class T>
189  typename automaton_traits<T>::hstate_t
190  op_dst_of(const AutomataBase<S>&, const IdentityView<T>&,
191  const typename automaton_traits<T>::htransition_t&);
192 
193  template <class S, class T>
194  typename Element<S, T>::label_t
195  op_label_of(const AutomataBase<S>&, const IdentityView<T>&,
196  const typename automaton_traits<T>::htransition_t&);
197 
198  template <class S, class T>
199  const typename Element<S, T>::series_set_elt_t
200  op_series_of(const AutomataBase<S>&, const IdentityView<T>&,
201  const typename automaton_traits<T>::htransition_t&);
202 
203  template <class S, class T>
204  typename Element<S, T>::series_set_elt_value_t
205  op_series_value_of(const AutomataBase<S>&, const IdentityView<T>&,
206  const typename automaton_traits<T>::htransition_t&);
207 
208 
209  template <class S, class T>
210  typename Element<S, T>::monoid_elt_t
211  op_word_of(const AutomataBase<S>&, const IdentityView<T>&,
212  const typename automaton_traits<T>::htransition_t&);
213 
214  template <class S, class T>
215  typename Element<S, T>::monoid_elt_value_t
216  op_word_value_of(const AutomataBase<S>&, const IdentityView<T>&,
217  const typename automaton_traits<T>::htransition_t&);
218 
219  template <class S, class T>
220  typename Element<S, T>::letter_t
221  op_letter_of(const AutomataBase<S>&, const IdentityView<T>&,
222  const typename automaton_traits<T>::htransition_t&);
223 
224  template <class S, class T>
225  bool
226  op_is_spontaneous(const AutomataBase<S>&, const IdentityView<T>&,
227  const typename automaton_traits<T>::htransition_t&);
228 
229 } // vcsn
230 
231 # undef AutoType
232 
233 
234 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
235 # include <vaucanson/automata/implementation/automaton_view.hxx>
236 #endif // VCSN_USE_INTERFACE_ONLY
237 
238 
239 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_AUTOMATON_VIEW_HH