1 #ifndef VCSN_DYN_WEIGHT_HH
2 # define VCSN_DYN_WEIGHT_HH
23 virtual std::string
vname(
bool full =
true)
const = 0;
26 template <
typename WeightSet>
33 template <
typename WeightSet>
41 template <
typename WeightSet>
42 class weight_wrapper:
public weight_base
47 using weight_t =
typename weightset_t::value_t;
53 virtual std::string
vname(
bool full =
true)
const override
77 using weight = std::shared_ptr<const detail::weight_base>;
79 template <
typename WeightSet>
83 const typename WeightSet::value_t& w)
85 return std::make_shared<detail::weight_wrapper<WeightSet>>(w, ws);
90 #endif // !VCSN_DYN_WEIGHT_HH
virtual std::string vname(bool full=true) const override
A description of the weight type.
weight_wrapper< WeightSet > & as()
Extract wrapped typed weight.
const weightset_t weightset_
The weight set.
const weight_wrapper< WeightSet > & as() const
Extract wrapped typed weight.
const weight_t weight_
The weight.
std::shared_ptr< const detail::weight_base > weight
const weight_t weight() const
weight make_weight(const WeightSet &ws, const typename WeightSet::value_t &w)
const weightset_t & weightset() const
weight_wrapper(const weight_t &w, const weightset_t &ws)
Aggregate a weight and its weightset.
typename weightset_t::value_t weight_t