17 #ifndef AWALI_CORE_AUTOMATON_DECORATOR_HH
18 # define AWALI_CORE_AUTOMATON_DECORATOR_HH
23 namespace awali {
namespace sttc {
33 template <
typename Aut,
34 typename Context = context_t_of<Aut>>
46 using kind_t =
typename context_t::kind_t;
50 using label_t =
typename labelset_t::value_t;
54 using weight_t =
typename weightset_t::value_t;
71 std::swap(
aut_, aut.aut_);
77 aut_ = std::move(that.aut_);
98 # define DEFINE(Name) \
99 template <typename... Args> \
102 Name(Args&&... args) \
103 -> decltype(automaton_t::element_type::Name(std::forward<Args>(args)...)) \
105 return automaton_t::element_type::Name(std::forward<Args>(args)...); \
120 # define DEFINE(Name) \
121 template <typename... Args> \
123 Name(Args&&... args) const \
124 -> decltype(aut_->Name(std::forward<Args>(args)...)) \
126 return aut_->Name(std::forward<Args>(args)...); \
170 # define DEFINE(Name) \
171 template <typename... Args> \
173 Name(Args&&... args) \
174 -> decltype(aut_->Name(std::forward<Args>(args)...)) \
176 return aut_->Name(std::forward<Args>(args)...); \
#define DEFINE(Name)
Definition: automaton_decorator.hh:170
carries the algebraic settings of automata
Definition: context.hh:40
Aggregate an automaton, and forward calls to it.
Definition: automaton_decorator.hh:36
auto dst_of(Args &&... args) const -> decltype(aut_-> dst_of(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:134
auto final_transitions(Args &&... args) const -> decltype(aut_-> final _transitions(std
Definition: automaton_decorator.hh:135
auto set_transition(Args &&... args) -> decltype(aut_-> set_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:193
auto print_state_name(Args &&... args) const -> decltype(aut_-> print_state_name(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:155
auto label_of(Args &&... args) const -> decltype(aut_-> label_of(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:145
auto new_transition_copy(Args &&... args) -> decltype(aut_-> new_transition_copy(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:189
Aut automaton_t
The type of automaton to wrap.
Definition: automaton_decorator.hh:39
auto weight_of(Args &&... args) const -> decltype(aut_-> weight_of(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:160
static constexpr auto post(Args &&... args) -> decltype(automaton_t::element_type::post(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:110
typename context_t::kind_t kind_t
Definition: automaton_decorator.hh:46
auto add_final(Args &&... args) -> decltype(aut_-> add_ final(std
Definition: automaton_decorator.hh:179
auto set_initial(Args &&... args) -> decltype(aut_-> set_initial(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:192
auto outin(Args &&... args) const -> decltype(aut_-> outin(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:153
automaton_decorator(automaton_decorator &&aut)
Definition: automaton_decorator.hh:69
static constexpr auto sname(Args &&... args) -> decltype(automaton_t::element_type::sname(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:112
auto print_state(Args &&... args) const -> decltype(aut_-> print_state(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:154
auto is_initial(Args &&... args) const -> decltype(aut_-> is_initial(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:144
static constexpr auto null_state(Args &&... args) -> decltype(automaton_t::element_type::null_state(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:108
auto states(Args &&... args) const -> decltype(aut_-> states(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:157
auto all_out(Args &&... args) const -> decltype(aut_-> all_out(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:130
automaton_decorator & operator=(automaton_decorator &&that)
Definition: automaton_decorator.hh:74
auto src_of(Args &&... args) const -> decltype(aut_-> src_of(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:156
auto add_initial(Args &&... args) -> decltype(aut_-> add_initial(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:180
auto has_state(Args &&... args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:140
auto num_initials(Args &&... args) const -> decltype(aut_-> num_initials(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:149
auto num_all_states(Args &&... args) const -> decltype(aut_-> num_all_states(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:147
auto labelset(Args &&... args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:146
auto new_transition(Args &&... args) -> decltype(aut_-> new_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:188
auto add_weight(Args &&... args) -> decltype(aut_-> add_weight(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:183
automaton_decorator(const automaton_decorator &aut)
Definition: automaton_decorator.hh:61
static constexpr auto pre(Args &&... args) -> decltype(automaton_t::element_type::pre(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:111
auto is_final(Args &&... args) const -> decltype(aut_-> is_ final(std
Definition: automaton_decorator.hh:143
typename context_t::labelset_ptr labelset_ptr
Definition: automaton_decorator.hh:49
typename labelset_t::value_t label_t
Definition: automaton_decorator.hh:50
auto unset_initial(Args &&... args) -> decltype(aut_-> unset_initial(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:196
auto add_state(Args &&... args) -> decltype(aut_-> add_state(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:187
auto initial_transitions(Args &&... args) const -> decltype(aut_-> initial_transitions(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:142
auto transitions(Args &&... args) const -> decltype(aut_-> transitions(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:158
auto num_finals(Args &&... args) const -> decltype(aut_-> num_ final s(std
Definition: automaton_decorator.hh:148
auto num_transitions(Args &&... args) const -> decltype(aut_-> num_transitions(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:151
typename context_t::weightset_ptr weightset_ptr
Definition: automaton_decorator.hh:53
auto in(Args &&... args) const -> decltype(aut_-> in(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:141
static constexpr auto null_transition(Args &&... args) -> decltype(automaton_t::element_type::null_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:109
auto has_transition(Args &&... args) const -> decltype(aut_-> has_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:139
auto all_in(Args &&... args) const -> decltype(aut_-> all_in(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:129
typename automaton_t::element_type::automaton_nocv_t automaton_nocv_t
The (shared pointer) type to use it we have to create an automaton of the same (underlying) type.
Definition: automaton_decorator.hh:43
auto del_state(Args &&... args) -> decltype(aut_-> del_state(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:184
Context context_t
Definition: automaton_decorator.hh:45
typename weightset_t::value_t weight_t
Definition: automaton_decorator.hh:54
auto add_transition_copy(Args &&... args) -> decltype(aut_-> add_transition_copy(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:182
auto num_states(Args &&... args) const -> decltype(aut_-> num_states(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:150
automaton_decorator(const context_t &ctx)
Definition: automaton_decorator.hh:65
auto get_initial_weight(Args &&... args) const -> decltype(aut_-> get_initial_weight(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:137
auto vname(Args &&... args) const -> decltype(aut_-> vname(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:159
auto weightset(Args &&... args) const -> decltype(aut_-> weightset(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:161
automaton_decorator(automaton_t aut)
Definition: automaton_decorator.hh:57
automaton_t strip_history()
Definition: automaton_decorator.hh:82
auto out(Args &&... args) const -> decltype(aut_-> out(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:152
typename context_t::labelset_t labelset_t
Definition: automaton_decorator.hh:48
auto rmul_weight(Args &&... args) -> decltype(aut_-> rmul_weight(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:190
auto set_weight(Args &&... args) -> decltype(aut_-> set_weight(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:194
automaton_t aut_
The wrapped automaton, possibly const.
Definition: automaton_decorator.hh:90
auto set_final(Args &&... args) -> decltype(aut_-> set_ final(std
Definition: automaton_decorator.hh:191
auto unset_final(Args &&... args) -> decltype(aut_-> unset_ final(std
Definition: automaton_decorator.hh:195
auto all_states(Args &&... args) const -> decltype(aut_-> all_states(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:131
auto get_final_weight(Args &&... args) const -> decltype(aut_-> get_ final _weight(std
Definition: automaton_decorator.hh:136
auto get_transition(Args &&... args) const -> decltype(aut_-> get_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:138
auto add_transition(Args &&... args) -> decltype(aut_-> add_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:181
typename context_t::weightset_t weightset_t
Definition: automaton_decorator.hh:52
auto del_transition(Args &&... args) -> decltype(aut_-> del_transition(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:185
auto all_transitions(Args &&... args) const -> decltype(aut_-> all_transitions(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:132
auto lmul_weight(Args &&... args) -> decltype(aut_-> lmul_weight(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:186
SharedPtr make_shared_ptr(Args &&... args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
Definition: memory.hh:29
Main namespace of Awali.
Definition: ato.hh:22