Vcsn  2.2
Be Rational
vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts > Class Template Reference

Decorator implementing the laziness for an algorithm. More...

#include <lazy-tuple-automaton.hh>

Inheritance diagram for vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >:
Collaboration diagram for vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >:

Public Types

using tuple_automaton_t = tuple_automaton< Aut, Auts... >
 The underlying automaton, output and inputs. More...
 
using state_name_t = typename tuple_automaton_t::element_type::state_name_t
 
using state_t = typename tuple_automaton_t::element_type::state_t
 
template<size_t... I>
using seq = typename tuple_automaton_t::element_type::template seq< I... >
 
using self_t = lazy_tuple_automaton
 
using super_t = automaton_decorator< tuple_automaton_t >
 
using decorated_t = Decorated
 The automaton holding the logic. More...
 
using weightset_t = weightset_t_of< Aut >
 
- Public Types inherited from vcsn::detail::automaton_decorator< tuple_automaton< Aut, Auts... > >
using automaton_t = Aut
 The type of automaton to wrap. More...
 
using context_t = context_t_of< Aut >
 
using element_type = typename automaton_t::element_type
 The automaton type, without shared_ptr. More...
 
using fresh_automaton_t = typename element_type::template fresh_automaton_t< Ctx >
 The (shared pointer) type to use it we have to create an automaton of the same (underlying) type. More...
 
using kind_t = typename context_t::kind_t
 
using labelset_t = typename context_t::labelset_t
 
using labelset_ptr = typename context_t::labelset_ptr
 
using label_t = typename labelset_t::value_t
 
using weightset_t = typename context_t::weightset_t
 
using weightset_ptr = typename context_t::weightset_ptr
 
using weight_t = typename weightset_t::value_t
 
using state_t = state_t_of< automaton_t >
 
using transition_t = transition_t_of< automaton_t >
 

Public Member Functions

 lazy_tuple_automaton (Aut aut, const Auts &...auts)
 
auto origins () const -> decltype(aut_->origins())
 A map from result state to tuple of original states. More...
 
template<bool L = Lazy>
std::enable_if_t< L, voidcomplete_ (state_t s) const
 Complete a state: find its outgoing transitions. More...
 
template<bool L = Lazy>
std::enable_if_t<!L, voidcomplete_ (state_t s) const
 
auto all_out (state_t s) const -> decltype(all_out(aut_, s))
 All the outgoing transitions. More...
 
- Public Member Functions inherited from vcsn::detail::automaton_decorator< tuple_automaton< Aut, Auts... > >
 automaton_decorator (automaton_t aut)
 
 automaton_decorator (const automaton_decorator &aut)
 
 automaton_decorator (const context_t &ctx)
 
 automaton_decorator (automaton_decorator &&aut)
 
automaton_decoratoroperator= (automaton_decorator &&that)
 
automaton_t strip ()
 The automaton we decorate. More...
 
auto all_in (Args &&...args) const -> decltype(aut_-> all_in(std::forward< Args >(args)...))
 
auto all_out (Args &&...args) const -> decltype(aut_-> all_out(std::forward< Args >(args)...))
 
auto all_states (Args &&...args) const -> decltype(aut_-> all_states(std::forward< Args >(args)...))
 
auto all_transitions (Args &&...args) const -> decltype(aut_-> all_transitions(std::forward< Args >(args)...))
 
auto context (Args &&...args) const -> decltype(aut_-> context(std::forward< Args >(args)...))
 
auto dst_of (Args &&...args) const -> decltype(aut_-> dst_of(std::forward< Args >(args)...))
 
auto get_final_weight (Args &&...args) const -> decltype(aut_-> get_ final _weight(std
 
auto get_initial_weight (Args &&...args) const -> decltype(aut_-> get_initial_weight(std::forward< Args >(args)...))
 
auto get_transition (Args &&...args) const -> decltype(aut_-> get_transition(std::forward< Args >(args)...))
 
auto has_state (Args &&...args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...))
 
auto has_transition (Args &&...args) const -> decltype(aut_-> has_transition(std::forward< Args >(args)...))
 
auto is_final (Args &&...args) const -> decltype(aut_-> is_ final(std
 
auto is_initial (Args &&...args) const -> decltype(aut_-> is_initial(std::forward< Args >(args)...))
 
auto label_of (Args &&...args) const -> decltype(aut_-> label_of(std::forward< Args >(args)...))
 
auto labelset (Args &&...args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...))
 
auto num_all_states (Args &&...args) const -> decltype(aut_-> num_all_states(std::forward< Args >(args)...))
 
auto num_finals (Args &&...args) const -> decltype(aut_-> num_ final s(std
 
auto num_initials (Args &&...args) const -> decltype(aut_-> num_initials(std::forward< Args >(args)...))
 
auto num_states (Args &&...args) const -> decltype(aut_-> num_states(std::forward< Args >(args)...))
 
auto num_transitions (Args &&...args) const -> decltype(aut_-> num_transitions(std::forward< Args >(args)...))
 
auto prepost_label (Args &&...args) const -> decltype(aut_-> prepost_label(std::forward< Args >(args)...))
 
auto print (Args &&...args) const -> decltype(aut_-> print(std::forward< Args >(args)...))
 
auto print_set (Args &&...args) const -> decltype(aut_-> print_set(std::forward< Args >(args)...))
 
auto print_state (Args &&...args) const -> decltype(aut_-> print_state(std::forward< Args >(args)...))
 
auto print_state_name (Args &&...args) const -> decltype(aut_-> print_state_name(std::forward< Args >(args)...))
 
auto src_of (Args &&...args) const -> decltype(aut_-> src_of(std::forward< Args >(args)...))
 
auto state_has_name (Args &&...args) const -> decltype(aut_-> state_has_name(std::forward< Args >(args)...))
 
auto is_lazy (Args &&...args) const -> decltype(aut_-> is_lazy(std::forward< Args >(args)...))
 
auto is_lazy_in (Args &&...args) const -> decltype(aut_-> is_lazy_in(std::forward< Args >(args)...))
 
auto states (Args &&...args) const -> decltype(aut_-> states(std::forward< Args >(args)...))
 
auto weight_of (Args &&...args) const -> decltype(aut_-> weight_of(std::forward< Args >(args)...))
 
auto weightset (Args &&...args) const -> decltype(aut_-> weightset(std::forward< Args >(args)...))
 
auto add_final (Args &&...args) -> decltype(aut_-> add_ final(std
 
auto add_initial (Args &&...args) -> decltype(aut_-> add_initial(std::forward< Args >(args)...))
 
auto add_transition (Args &&...args) -> decltype(aut_-> add_transition(std::forward< Args >(args)...))
 
auto add_transition_copy (Args &&...args) -> decltype(aut_-> add_transition_copy(std::forward< Args >(args)...))
 
auto add_weight (Args &&...args) -> decltype(aut_-> add_weight(std::forward< Args >(args)...))
 
auto del_state (Args &&...args) -> decltype(aut_-> del_state(std::forward< Args >(args)...))
 
auto del_transition (Args &&...args) -> decltype(aut_-> del_transition(std::forward< Args >(args)...))
 
auto lmul_weight (Args &&...args) -> decltype(aut_-> lmul_weight(std::forward< Args >(args)...))
 
auto new_state (Args &&...args) -> decltype(aut_-> new_state(std::forward< Args >(args)...))
 
auto new_transition (Args &&...args) -> decltype(aut_-> new_transition(std::forward< Args >(args)...))
 
auto new_transition_copy (Args &&...args) -> decltype(aut_-> new_transition_copy(std::forward< Args >(args)...))
 
auto rmul_weight (Args &&...args) -> decltype(aut_-> rmul_weight(std::forward< Args >(args)...))
 
auto set_final (Args &&...args) -> decltype(aut_-> set_ final(std
 
auto set_lazy (Args &&...args) -> decltype(aut_-> set_lazy(std::forward< Args >(args)...))
 
auto set_lazy_in (Args &&...args) -> decltype(aut_-> set_lazy_in(std::forward< Args >(args)...))
 
auto set_initial (Args &&...args) -> decltype(aut_-> set_initial(std::forward< Args >(args)...))
 
auto set_transition (Args &&...args) -> decltype(aut_-> set_transition(std::forward< Args >(args)...))
 
auto set_weight (Args &&...args) -> decltype(aut_-> set_weight(std::forward< Args >(args)...))
 
auto unset_final (Args &&...args) -> decltype(aut_-> unset_ final(std
 
auto unset_initial (Args &&...args) -> decltype(aut_-> unset_initial(std::forward< Args >(args)...))
 

Static Public Member Functions

template<typename... T>
static symbol sname_ (const T &...t)
 
- Static Public Member Functions inherited from vcsn::detail::automaton_decorator< tuple_automaton< Aut, Auts... > >
static constexpr auto lazy_transition (Args &&...args) -> decltype(element_type::lazy_transition(std::forward< Args >(args)...))
 
static constexpr auto null_state (Args &&...args) -> decltype(element_type::null_state(std::forward< Args >(args)...))
 
static constexpr auto null_transition (Args &&...args) -> decltype(element_type::null_transition(std::forward< Args >(args)...))
 
static constexpr auto post (Args &&...args) -> decltype(element_type::post(std::forward< Args >(args)...))
 
static constexpr auto pre (Args &&...args) -> decltype(element_type::pre(std::forward< Args >(args)...))
 
static constexpr auto sname (Args &&...args) -> decltype(element_type::sname(std::forward< Args >(args)...))
 

Protected Types

template<typename A >
using transition_map_t = transition_map< A, weightset_t, false, true, KeepTransitions >
 The type of our transition maps: convert the weight to weightset_t, non deterministic, and including transitions to post(). More...
 

Protected Member Functions

template<typename... Args>
state_t state (Args &&...args)
 Conversion from state name to state number. More...
 
std::tuple< typename transition_map_t< Auts >::map_t &... > out_ (const state_name_t &ss)
 The outgoing tuple of transitions from state tuple ss. More...
 
template<size_t... I>
std::tuple< typename transition_map_t< Auts >::map_t &... > out_ (const state_name_t &ss, seq< I... >)
 

Protected Attributes

const weightset_tws_ = *aut_->weightset()
 The resulting weightset. More...
 
std::tuple< transition_map_t< Auts >... > transition_maps_
 Transition caches. More...
 
- Protected Attributes inherited from vcsn::detail::automaton_decorator< tuple_automaton< Aut, Auts... > >
automaton_t aut_
 The wrapped automaton, possibly const. More...
 

Detailed Description

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
class vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >

Decorator implementing the laziness for an algorithm.

The caller must inherit from lazy_tuple_automaton, and pass itself as first template parameter of lazy_automaton (Curiously Recurring Template Pattern), e.g.: class A : lazy_tuple_automaton<A, ...>

The caller must also define the add_transitions method: void add_transitions(const state_t src, const state_name_t& psrc)

This method tells the lazy decorator how to compute the outgoing transitions for a state.

Template Parameters
Decoratedthe class inheriting from lazy_tuple_automaton
KeepTransitionssee vcsn/core/transition-map.hh
Autthe output automaton type
Autsthe input automaton types

Definition at line 35 of file lazy-tuple-automaton.hh.

Member Typedef Documentation

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::decorated_t = Decorated

The automaton holding the logic.

Definition at line 56 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::self_t = lazy_tuple_automaton

Definition at line 52 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<size_t... I>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::seq = typename tuple_automaton_t::element_type::template seq<I...>

Definition at line 50 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::state_name_t = typename tuple_automaton_t::element_type::state_name_t

Definition at line 43 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::state_t = typename tuple_automaton_t::element_type::state_t

Definition at line 45 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::super_t = automaton_decorator<tuple_automaton_t>

Definition at line 53 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<typename A >
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::transition_map_t = transition_map<A, weightset_t, false, true, KeepTransitions>
protected

The type of our transition maps: convert the weight to weightset_t, non deterministic, and including transitions to post().

Definition at line 121 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::tuple_automaton_t = tuple_automaton<Aut, Auts...>

The underlying automaton, output and inputs.

Definition at line 41 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
using vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::weightset_t = weightset_t_of<Aut>

Definition at line 58 of file lazy-tuple-automaton.hh.

Constructor & Destructor Documentation

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::lazy_tuple_automaton ( Aut  aut,
const Auts &...  auts 
)
inline

Definition at line 62 of file lazy-tuple-automaton.hh.

Member Function Documentation

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
auto vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::all_out ( state_t  s) const -> decltype(all_out(aut_, s))
inline

All the outgoing transitions.

Definition at line 106 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<bool L = Lazy>
std::enable_if_t<L, void> vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::complete_ ( state_t  s) const
inline
template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<bool L = Lazy>
std::enable_if_t<!L, void> vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::complete_ ( state_t  s) const
inline

Definition at line 97 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
auto vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::origins ( ) const -> decltype(aut_->origins())
inline

A map from result state to tuple of original states.

Definition at line 79 of file lazy-tuple-automaton.hh.

Referenced by vcsn::detail::lazy_tuple_automaton< product_automaton_impl< Lazy, Aut, Auts... >, false, Lazy, Aut, Auts... >::complete_().

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
std::tuple<typename transition_map_t<Auts>::map_t&...> vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::out_ ( const state_name_t ss)
inlineprotected

The outgoing tuple of transitions from state tuple ss.

Definition at line 133 of file lazy-tuple-automaton.hh.

Referenced by vcsn::detail::lazy_tuple_automaton< product_automaton_impl< Lazy, Aut, Auts... >, false, Lazy, Aut, Auts... >::out_().

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<size_t... I>
std::tuple<typename transition_map_t<Auts>::map_t&...> vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::out_ ( const state_name_t ss,
seq< I... >   
)
inlineprotected

Definition at line 140 of file lazy-tuple-automaton.hh.

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<typename... T>
static symbol vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::sname_ ( const T &...  t)
inlinestatic
template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
template<typename... Args>
state_t vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::state ( Args &&...  args)
inlineprotected

Conversion from state name to state number.

Definition at line 126 of file lazy-tuple-automaton.hh.

Member Data Documentation

template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
std::tuple<transition_map_t<Auts>...> vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::transition_maps_
protected
template<typename Decorated, bool KeepTransitions, bool Lazy, typename Aut, typename... Auts>
const weightset_t& vcsn::detail::lazy_tuple_automaton< Decorated, KeepTransitions, Lazy, Aut, Auts >::ws_ = *aut_->weightset()
protected

The resulting weightset.

Definition at line 147 of file lazy-tuple-automaton.hh.


The documentation for this class was generated from the following file: