Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::detail::outputter< Aut > Class Template Reference

Factor common bits in automaton formatting. More...

#include <grail.hh>

Inheritance diagram for vcsn::detail::outputter< Aut >:
Collaboration diagram for vcsn::detail::outputter< Aut >:

Public Types

using state_t = state_t_of< automaton_t >
 

Public Member Functions

 outputter (const automaton_t &aut, std::ostream &out)
 

Protected Types

using automaton_t = Aut
 
using context_t = context_t_of< automaton_t >
 
using label_t = label_t_of< automaton_t >
 
using transition_t = transition_t_of< automaton_t >
 
using weightset_t = weightset_t_of< automaton_t >
 
using weight_t = weight_t_of< automaton_t >
 
using states_t = std::vector< state_t >
 A list of states. More...
 

Protected Member Functions

virtual std::string label_ (const label_t &l)
 Convert a label to its representation. More...
 
virtual void output_transition_ (transition_t t)
 Output the transition t. More...
 
std::ostream & print_entry_ (state_t src, state_t dst, std::ostream &os, const std::string &fmt="text")
 The labels and weights of transitions from src to dst. More...
 
void output_state_ (const state_t s)
 Output transitions, sorted lexicographically on (Label, Dest). More...
 
void output_transitions_ ()
 Output transitions, sorted lexicographically. More...
 
void list_states_ (const states_t &ss)
 List names of states in ss, preceded by ' '. More...
 
states_t initials_ ()
 The list of initial states, sorted. More...
 
states_t finals_ ()
 The list of final states, sorted. More...
 

Protected Attributes

const automaton_taut_
 The automaton we have to output. More...
 
std::ostream & os_
 Output stream. More...
 
const labelset_t_of
< automaton_t > & 
ls_ = *aut_->labelset()
 Short-hand to the labelset. More...
 
const weightset_tws_ = *aut_->weightset()
 Short-hand to the weightset. More...
 
const polynomialset
< context_t_of< automaton_t > > 
ps_ {aut_->context()}
 Short-hand to the polynomialset used to print the entries. More...
 

Detailed Description

template<typename Aut>
class vcsn::detail::outputter< Aut >

Factor common bits in automaton formatting.

Template Parameters
Autan automaton type.

Definition at line 27 of file grail.hh.

Member Typedef Documentation

template<typename Aut >
using vcsn::detail::outputter< Aut >::automaton_t = Aut
protected

Definition at line 30 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::context_t = context_t_of<automaton_t>
protected

Definition at line 43 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::label_t = label_t_of<automaton_t>
protected

Definition at line 44 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::state_t = state_t_of<automaton_t>

Definition at line 40 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::states_t = std::vector<state_t>
protected

A list of states.

Definition at line 50 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::transition_t = transition_t_of<automaton_t>
protected

Definition at line 45 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::weight_t = weight_t_of<automaton_t>
protected

Definition at line 47 of file grail.hh.

template<typename Aut >
using vcsn::detail::outputter< Aut >::weightset_t = weightset_t_of<automaton_t>
protected

Definition at line 46 of file grail.hh.

Constructor & Destructor Documentation

template<typename Aut >
vcsn::detail::outputter< Aut >::outputter ( const automaton_t aut,
std::ostream &  out 
)
inline

Definition at line 33 of file grail.hh.

Member Function Documentation

template<typename Aut >
states_t vcsn::detail::outputter< Aut >::finals_ ( )
inlineprotected

The list of final states, sorted.

Definition at line 131 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, and vcsn::sort().

Referenced by vcsn::detail::fadoer< Aut >::operator()(), vcsn::detail::grailer< Aut >::operator()(), and vcsn::detail::dotter< Aut >::print_states_().

Here is the call graph for this function:

template<typename Aut >
states_t vcsn::detail::outputter< Aut >::initials_ ( )
inlineprotected

The list of initial states, sorted.

Definition at line 121 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, and vcsn::sort().

Referenced by vcsn::detail::fadoer< Aut >::operator()(), vcsn::detail::grailer< Aut >::operator()(), and vcsn::detail::dotter< Aut >::print_states_().

Here is the call graph for this function:

template<typename Aut >
virtual std::string vcsn::detail::outputter< Aut >::label_ ( const label_t l)
inlineprotectedvirtual

Convert a label to its representation.

Definition at line 54 of file grail.hh.

References vcsn::detail::outputter< Aut >::ls_, and vcsn::to_string().

Referenced by vcsn::detail::outputter< Aut >::output_transition_().

Here is the call graph for this function:

template<typename Aut >
void vcsn::detail::outputter< Aut >::list_states_ ( const states_t ss)
inlineprotected

List names of states in ss, preceded by ' '.

Definition at line 111 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, and vcsn::detail::outputter< Aut >::os_.

Referenced by vcsn::detail::fadoer< Aut >::operator()().

template<typename Aut >
void vcsn::detail::outputter< Aut >::output_state_ ( const state_t  s)
inlineprotected

Output transitions, sorted lexicographically on (Label, Dest).

Definition at line 82 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::outputter< Aut >::os_, vcsn::detail::outputter< Aut >::output_transition_(), and vcsn::sort().

Referenced by vcsn::detail::outputter< Aut >::output_transitions_(), and vcsn::detail::efsmer< Aut >::output_transitions_().

Here is the call graph for this function:

template<typename Aut >
virtual void vcsn::detail::outputter< Aut >::output_transition_ ( transition_t  t)
inlineprotectedvirtual

Output the transition t.

Do not insert eol. "Src Label Dst".

Definition at line 61 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::outputter< Aut >::label_(), and vcsn::detail::outputter< Aut >::os_.

Referenced by vcsn::detail::outputter< Aut >::output_state_().

Here is the call graph for this function:

template<typename Aut >
void vcsn::detail::outputter< Aut >::output_transitions_ ( )
inlineprotected

Output transitions, sorted lexicographically.

"Src Label Dst\n".

Definition at line 104 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, and vcsn::detail::outputter< Aut >::output_state_().

Referenced by vcsn::detail::fadoer< Aut >::operator()(), and vcsn::detail::grailer< Aut >::operator()().

Here is the call graph for this function:

template<typename Aut >
std::ostream& vcsn::detail::outputter< Aut >::print_entry_ ( state_t  src,
state_t  dst,
std::ostream &  os,
const std::string &  fmt = "text" 
)
inlineprotected

The labels and weights of transitions from src to dst.

The main advantage of using polynomials instead of directly iterating over aut_->outin(src, dst) is to get a result which is sorted (hence more deterministic).

Definition at line 73 of file grail.hh.

References vcsn::detail::outputter< Aut >::aut_, vcsn::get_entry(), vcsn::polynomialset< Context >::print(), and vcsn::detail::outputter< Aut >::ps_.

Referenced by vcsn::detail::tikzer< Aut >::operator()(), and vcsn::detail::dotter< Aut >::print_transitions_().

Here is the call graph for this function:

Member Data Documentation

template<typename Aut >
const labelset_t_of<automaton_t>& vcsn::detail::outputter< Aut >::ls_ = *aut_->labelset()
protected
template<typename Aut >
const polynomialset<context_t_of<automaton_t> > vcsn::detail::outputter< Aut >::ps_ {aut_->context()}
protected

Short-hand to the polynomialset used to print the entries.

Definition at line 149 of file grail.hh.

Referenced by vcsn::detail::outputter< Aut >::print_entry_().

template<typename Aut >
const weightset_t& vcsn::detail::outputter< Aut >::ws_ = *aut_->weightset()
protected

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