1 #ifndef VCSN_CORE_RAT_COPY_HH
2 # define VCSN_CORE_RAT_COPY_HH
14 template <
typename InRatExpSet,
typename OutRatExpSet = InRatExpSet>
16 :
public InRatExpSet::const_visitor
23 using super_t =
typename in_ratexpset_t::const_visitor;
24 using node_t =
typename super_t::node_t;
25 using inner_t =
typename super_t::inner_t;
26 template <type_t Type>
28 template <type_t Type>
30 using leaf_t =
typename super_t::leaf_t;
46 template <exp::type_t Type>
50 using out_unary_t =
typename out_ratexpset_t::template
unary_t<Type>;
51 res_ = std::make_shared<out_unary_t>(
copy(v.sub()));
55 template <exp::type_t Type>
60 typename out_ratexpset_t::values_t sub;
62 sub.emplace_back(
copy(s));
63 res_ = std::make_shared<out_variadic_t>(sub);
73 # define DEFINE(Type) \
74 using Type ## _t = typename super_t::Type ## _t; \
75 virtual void visit(const Type ## _t& v)
129 template <
typename InRatExpSet,
typename OutRatExpSet = InRatExpSet>
130 typename OutRatExpSet::value_t
131 copy(
const InRatExpSet& in_rs,
const OutRatExpSet& out_rs,
132 const typename InRatExpSet::value_t& v)
141 #endif // !VCSN_CORE_RAT_COPY_HH
typename in_ratexpset_t::const_visitor super_t
An inner node with multiple children.
typename super_t::node_t node_t
OutRatExpSet::value_t copy(const InRatExpSet &in_rs, const OutRatExpSet &out_rs, const typename InRatExpSet::value_t &v)
typename super_t::leaf_t leaf_t
void copy_variadic(const variadic_t< Type > &v)
Factor the copy of n-ary operations.
typename in_ratexpset_t::value_t in_value_t
const in_ratexpset_t & in_rs_
ratexpset to decode the input value.
const out_ratexpset_t & out_rs_
ratexpset to build the output value.
typename super_t::template variadic_t< Type > variadic_t
typename out_ratexpset_t::value_t out_value_t
OutRatExpSet out_ratexpset_t
InRatExpSet in_ratexpset_t
copier(const in_ratexpset_t &in_rs, const out_ratexpset_t &out_rs)
typename super_t::template unary_t< Type > unary_t
out_value_t res_
Output value, under construction.
An inner node implementing a weight.
void copy_unary(const unary_t< Type > &v)
Factor the copy of n-ary operations.
out_value_t copy(const in_value_t &v)
typename super_t::inner_t inner_t
out_value_t operator()(const in_value_t &v)
Entry point: print v.