17 #ifndef VCSN_AUTOMATA_CONCEPT_COPY_HXX
18 # define VCSN_AUTOMATA_CONCEPT_COPY_HXX
21 # include <vaucanson/automata/concept/handlers.hh>
27 template<
typename lhs_t,
typename rhs_t>
28 void auto_copy(lhs_t& dst_,
31 lhs_t dst(dst_.structure());
32 typedef typename lhs_t::series_set_elt_t dst_series_set_elt_t;
34 std::map<typename rhs_t::hstate_t, typename lhs_t::hstate_t> stmap;
36 for (
typename rhs_t::state_iterator i = from.states().begin();
37 i != from.states().end();
40 typename lhs_t::hstate_t s = dst.add_state();
41 dst_series_set_elt_t s_(from.get_final(*i));
43 dst_series_set_elt_t s__(from.get_initial(*i));
44 dst.set_initial(s, s__);
48 for (
typename rhs_t::transition_iterator i = from.transitions().begin();
49 i != from.transitions().end();
52 dst_series_set_elt_t s(from.series_of(*i));
53 dst.add_series_transition(stmap[from.src_of(*i)], stmap[from.dst_of(*i)], s);
58 template<
typename auto_t>
59 auto_t auto_copy(
const auto_t& from)
69 #endif // ! VCSN_AUTOMATA_CONCEPT_COPY_HXX