Awali
Another Weighted Automata library
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
awali::sttc::internal::outputter< Aut > Class Template Reference

Factor common bits in automaton formatting. More...

#include <grail.hh>

Inheritance diagram for awali::sttc::internal::outputter< Aut >:
awali::sttc::internal::dautter< Aut > awali::sttc::internal::dotter< Aut > awali::sttc::internal::efsmer< Aut > awali::sttc::internal::fadoer< Aut > awali::sttc::internal::grailer< Aut > awali::sttc::internal::tikzer< Aut >

Public Member Functions

 outputter (const automaton_t &aut, std::ostream &out)
 
virtual ~outputter ()=default
 

Protected Types

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

Protected Member Functions

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

Protected Attributes

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

Detailed Description

template<typename Aut>
class awali::sttc::internal::outputter< Aut >

Factor common bits in automaton formatting.

Template Parameters
Autan automaton type.

Member Typedef Documentation

◆ automaton_t

template<typename Aut >
using awali::sttc::internal::outputter< Aut >::automaton_t = Aut
protected

◆ context_t

template<typename Aut >
using awali::sttc::internal::outputter< Aut >::context_t = context_t_of<automaton_t>
protected

◆ label_t

template<typename Aut >
using awali::sttc::internal::outputter< Aut >::label_t = label_t_of<automaton_t>
protected

◆ states_t

template<typename Aut >
using awali::sttc::internal::outputter< Aut >::states_t = std::vector<state_t>
protected

A list of states.

◆ weight_t

template<typename Aut >
using awali::sttc::internal::outputter< Aut >::weight_t = weight_t_of<automaton_t>
protected

◆ weightset_t

template<typename Aut >
using awali::sttc::internal::outputter< Aut >::weightset_t = weightset_t_of<automaton_t>
protected

Constructor & Destructor Documentation

◆ outputter()

template<typename Aut >
awali::sttc::internal::outputter< Aut >::outputter ( const automaton_t aut,
std::ostream &  out 
)

◆ ~outputter()

template<typename Aut >
virtual awali::sttc::internal::outputter< Aut >::~outputter ( )
virtualdefault

Member Function Documentation

◆ finals_()

template<typename Aut >
states_t awali::sttc::internal::outputter< Aut >::finals_ ( )
protected

The list of final states, sorted.

◆ format_entry_()

template<typename Aut >
std::string awali::sttc::internal::outputter< Aut >::format_entry_ ( state_t  src,
state_t  dst,
const std::string &  fmt = "text" 
)
protected

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).

◆ initials_()

template<typename Aut >
states_t awali::sttc::internal::outputter< Aut >::initials_ ( )
protected

The list of initial states, sorted.

◆ label_()

template<typename Aut >
virtual std::string awali::sttc::internal::outputter< Aut >::label_ ( const label_t l)
protectedvirtual

Convert a label to its representation.

◆ list_states_()

template<typename Aut >
void awali::sttc::internal::outputter< Aut >::list_states_ ( const states_t ss)
protected

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

◆ output_state_()

template<typename Aut >
void awali::sttc::internal::outputter< Aut >::output_state_ ( const state_t  s)
protected

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

◆ output_transition_()

template<typename Aut >
virtual void awali::sttc::internal::outputter< Aut >::output_transition_ ( transition_t  t)
protectedvirtual

Output the transition t.

Do not insert eol. "Src Label Dst".

◆ output_transitions_()

template<typename Aut >
void awali::sttc::internal::outputter< Aut >::output_transitions_ ( )
protected

Output transitions, sorted lexicographically.

"Src Label Dst\n".

Field Documentation

◆ aut_

template<typename Aut >
const automaton_t& awali::sttc::internal::outputter< Aut >::aut_
protected

The automaton we have to output.

◆ ls_

template<typename Aut >
const labelset_t_of<automaton_t>& awali::sttc::internal::outputter< Aut >::ls_ = *aut_->labelset()
protected

Short-hand to the labelset.

◆ os_

template<typename Aut >
std::ostream& awali::sttc::internal::outputter< Aut >::os_
protected

Output stream.

◆ ps_

template<typename Aut >
const polynomialset<context_t_of<automaton_t> > awali::sttc::internal::outputter< Aut >::ps_ {aut_->context()}
protected

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

◆ ws_

template<typename Aut >
const weightset_t& awali::sttc::internal::outputter< Aut >::ws_ = *aut_->weightset()
protected

Short-hand to the weightset.


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