00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH
00018 # define VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH
00019
00020 # include <vaucanson/automata/implementation/automaton_view.hh>
00021 # include <vaucanson/design_pattern/predecls.hh>
00022
00023 namespace vcsn {
00024
00035 template <class T>
00036 struct TransposeView : public IdentityView<T>
00037 {
00038 TransposeView();
00039 TransposeView(const T&);
00040 TransposeView(T&);
00041 TransposeView(const TransposeView&);
00042 };
00043
00045
00046 template <class T>
00047 struct transpose_traits
00048 {
00049 typedef undefined_type type;
00050 };
00051
00052 template <class S, class T>
00053 struct transpose_traits<Element<S, T> >
00054 {
00055 typedef Element<S, TransposeView<T> > type;
00056 };
00065 template <class S, class T>
00066 Element<S, TransposeView<T> >
00067 transpose_view(Element<S, T>&);
00068
00069 template <class S, class T>
00070 const Element<S, TransposeView<T> >
00071 transpose_view(const Element<S, T>&);
00074
00075 template <typename T>
00076 struct automaton_traits<TransposeView<T> >
00077 {
00078 typedef typename automaton_traits<T>::label_t label_t;
00079 typedef typename automaton_traits<T>::series_set_elt_value_t
00080 series_set_elt_value_t;
00081 typedef typename automaton_traits<T>::word_value_t word_value_t;
00082 typedef typename automaton_traits<T>::semiring_elt_value_t
00083 semiring_elt_value_t;
00084 typedef typename automaton_traits<T>::letter_t letter_t;
00085 typedef typename automaton_traits<T>::tag_t tag_t;
00086 typedef typename automaton_traits<T>::states_t states_t;
00087
00088 typedef typename automaton_traits<T>::state_iterator
00089 state_iterator;
00090 typedef typename automaton_traits<T>::transitions_t transitions_t;
00091
00092 typedef typename automaton_traits<T>::transition_iterator transition_iterator;
00093 typedef typename automaton_traits<T>::initial_t initial_t;
00094 typedef typename automaton_traits<T>::initial_iterator
00095 initial_iterator;
00096 typedef typename automaton_traits<T>::initial_support_t
00097 initial_support_t;
00098 typedef typename automaton_traits<T>::final_t final_t;
00099 typedef typename automaton_traits<T>::final_iterator
00100 final_iterator;
00101 typedef typename automaton_traits<T>::final_support_t
00102 final_support_t;
00103 typedef typename automaton_traits<T>::geometry_t geometry_t;
00104 typedef typename automaton_traits<T>::geometry_t::coords_t geometry_coords_t;
00105
00106
00107 typedef typename automaton_traits<T>::hstate_t hstate_t;
00108 typedef typename automaton_traits<T>::htransition_t htransition_t;
00109
00110 typedef typename automaton_traits<T>::rdelta_iterator delta_iterator;
00111 typedef typename automaton_traits<T>::delta_iterator rdelta_iterator;
00112 };
00113
00114 #define AutoType(Type) \
00115 typename Element<S, TransposeView<T> >::Type
00116
00118
00119 template <class S, class T>
00120 typename automaton_traits<TransposeView<T> >::initial_support_t
00121 op_initial(const AutomataBase<S>&, const TransposeView<T>&);
00122
00123 template <class S, class T>
00124 typename automaton_traits<TransposeView<T> >::final_support_t
00125 op_final(const AutomataBase<S>&, const TransposeView<T>&);
00126
00127 template <class S, class T>
00128 void
00129 op_set_initial(const AutomataBase<S>&, TransposeView<T>&,
00130 const typename automaton_traits<T>::hstate_t& state,
00131 const AutoType(series_set_elt_t)& s);
00132
00133 template <class S, class T>
00134 AutoType(series_set_elt_t)
00135 op_get_initial(const AutomataBase<S>&,
00136 const TransposeView<T>&,
00137 const typename automaton_traits<T>::hstate_t&);
00138
00139 template <class S, class T>
00140 void
00141 op_set_final(const AutomataBase<S>&, TransposeView<T>&,
00142 const typename automaton_traits<T>::hstate_t& state,
00143 const typename Element<S, T>::series_set_elt_t& s);
00144
00145 template <class S, class T>
00146 typename Element<S, T>::series_set_elt_t
00147 op_get_final(const AutomataBase<S>&,
00148 const TransposeView<T>&,
00149 const typename automaton_traits<T>::hstate_t& state);
00150
00151 template <class S, class T>
00152 void
00153 op_clear_initial(const AutomataBase<S>&, TransposeView<T>&);
00154
00155 template <class S, class T>
00156 void
00157 op_clear_final(const AutomataBase<S>&, TransposeView<T>&);
00158
00159 template <class S, class T>
00160 typename automaton_traits<T>::hstate_t
00161 op_src_of(const AutomataBase<S>&, const TransposeView<T>&,
00162 const typename automaton_traits<T>::htransition_t&);
00163
00164 template <class S, class T>
00165 typename automaton_traits<T>::hstate_t
00166 op_dst_of(const AutomataBase<S>&, const TransposeView<T>&,
00167 const typename automaton_traits<T>::htransition_t&);
00168
00171 }
00172
00173 # undef AutoType
00174
00175
00176 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00177 # include <vaucanson/automata/implementation/transpose_view.hxx>
00178 #endif // VCSN_USE_INTERFACE_ONLY
00179
00180
00181 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH