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

#include <setalpha.hh>

Inheritance diagram for vcsn::set_alphabet< L >:
Collaboration diagram for vcsn::set_alphabet< L >:

Public Types

using letter_t = typename L::letter_t
 
using word_t = typename L::word_t
 
using letters_t = std::set< letter_t >
 
using value_type = letter_t
 The type of our values, when seen as a container. More...
 
using iterator = typename letters_t::const_iterator
 
using const_iterator = typename letters_t::const_iterator
 

Public Member Functions

virtual std::string vname (bool full=true) const
 
 set_alphabet ()=default
 
 set_alphabet (const set_alphabet &)=default
 
 set_alphabet (const std::initializer_list< letter_t > &l)
 
 set_alphabet (const letters_t &l)
 
bool open (bool o) const
 Whether unknown letters should be added, or rejected. More...
 
set_alphabetadd_letter (letter_t l)
 Modify this by adding l, and return *this. More...
 
bool has (letter_t l) const
 Whether l is a letter. More...
 
word_t get_word (std::istream &i) const
 Extract and return the next word from i. More...
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator find (letter_t l) const
 
std::ostream & print_set (std::ostream &o, symbol format=symbol{"text"}) const
 

Static Public Member Functions

static std::string sname ()
 
static set_alphabet make (std::istream &is)
 

Private Attributes

letters_t alphabet_
 
bool open_ = false
 

Friends

template<typename L2 >
set_alphabet< L2 > intersection (const set_alphabet< L2 > &lhs, const set_alphabet< L2 > &rhs)
 Compute the intersection with another alphabet. More...
 
template<typename L2 >
set_alphabet< L2 > get_union (const set_alphabet< L2 > &lhs, const set_alphabet< L2 > &rhs)
 Compute the union with another alphabet. More...
 

Detailed Description

template<typename L>
class vcsn::set_alphabet< L >

Definition at line 18 of file setalpha.hh.

Member Typedef Documentation

template<typename L>
using vcsn::set_alphabet< L >::const_iterator = typename letters_t::const_iterator

Definition at line 181 of file setalpha.hh.

template<typename L>
using vcsn::set_alphabet< L >::iterator = typename letters_t::const_iterator

Definition at line 180 of file setalpha.hh.

template<typename L>
using vcsn::set_alphabet< L >::letter_t = typename L::letter_t

Definition at line 21 of file setalpha.hh.

template<typename L>
using vcsn::set_alphabet< L >::letters_t = std::set<letter_t>

Definition at line 23 of file setalpha.hh.

template<typename L>
using vcsn::set_alphabet< L >::value_type = letter_t

The type of our values, when seen as a container.

Definition at line 25 of file setalpha.hh.

template<typename L>
using vcsn::set_alphabet< L >::word_t = typename L::word_t

Definition at line 22 of file setalpha.hh.

Constructor & Destructor Documentation

template<typename L>
vcsn::set_alphabet< L >::set_alphabet ( )
default
template<typename L>
vcsn::set_alphabet< L >::set_alphabet ( const set_alphabet< L > &  )
default
template<typename L>
vcsn::set_alphabet< L >::set_alphabet ( const std::initializer_list< letter_t > &  l)
inline

Definition at line 104 of file setalpha.hh.

template<typename L>
vcsn::set_alphabet< L >::set_alphabet ( const letters_t l)
inline

Definition at line 108 of file setalpha.hh.

Member Function Documentation

template<typename L>
set_alphabet& vcsn::set_alphabet< L >::add_letter ( letter_t  l)
inline

Modify this by adding l, and return *this.

Definition at line 123 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_.

Referenced by vcsn::set_alphabet< L >::has(), and vcsn::set_alphabet< L >::make().

template<typename L>
const_iterator vcsn::set_alphabet< L >::begin ( ) const
inline

Definition at line 183 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_.

template<typename L>
const_iterator vcsn::set_alphabet< L >::cbegin ( ) const
inline

Definition at line 193 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_.

template<typename L>
const_iterator vcsn::set_alphabet< L >::cend ( ) const
inline

Definition at line 198 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_.

template<typename L>
const_iterator vcsn::set_alphabet< L >::end ( ) const
inline

Definition at line 188 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_.

template<typename L>
const_iterator vcsn::set_alphabet< L >::find ( letter_t  l) const
inline

Definition at line 203 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_.

template<typename L>
word_t vcsn::set_alphabet< L >::get_word ( std::istream &  i) const
inline

Extract and return the next word from i.

Definition at line 146 of file setalpha.hh.

References vcsn::set_alphabet< L >::has(), vcsn::require(), and vcsn::str_escape().

Here is the call graph for this function:

template<typename L>
bool vcsn::set_alphabet< L >::has ( letter_t  l) const
inline

Whether l is a letter.

Definition at line 132 of file setalpha.hh.

References vcsn::set_alphabet< L >::add_letter(), vcsn::set_alphabet< L >::alphabet_, vcsn::has(), and vcsn::set_alphabet< L >::open_.

Referenced by vcsn::set_alphabet< L >::get_word().

Here is the call graph for this function:

template<typename L>
static set_alphabet vcsn::set_alphabet< L >::make ( std::istream &  is)
inlinestatic

Definition at line 45 of file setalpha.hh.

References vcsn::set_alphabet< L >::add_letter(), vcsn::eat(), vcsn::set_alphabet< L >::open_, and vcsn::set_alphabet< L >::sname().

Here is the call graph for this function:

template<typename L>
bool vcsn::set_alphabet< L >::open ( bool  o) const
inline

Whether unknown letters should be added, or rejected.

Parameters
owhether to accept
Returns
the previous status.

Definition at line 115 of file setalpha.hh.

References vcsn::set_alphabet< L >::open_.

template<typename L>
std::ostream& vcsn::set_alphabet< L >::print_set ( std::ostream &  o,
symbol  format = symbol{"text"} 
) const
inline

Definition at line 209 of file setalpha.hh.

template<typename L>
static std::string vcsn::set_alphabet< L >::sname ( )
inlinestatic

Definition at line 27 of file setalpha.hh.

References vcsn::sname().

Referenced by vcsn::set_alphabet< L >::make(), and vcsn::set_alphabet< L >::vname().

Here is the call graph for this function:

template<typename L>
virtual std::string vcsn::set_alphabet< L >::vname ( bool  full = true) const
inlinevirtual

Definition at line 32 of file setalpha.hh.

References vcsn::set_alphabet< L >::alphabet_, and vcsn::set_alphabet< L >::sname().

Here is the call graph for this function:

Friends And Related Function Documentation

template<typename L>
template<typename L2 >
set_alphabet<L2> get_union ( const set_alphabet< L2 > &  lhs,
const set_alphabet< L2 > &  rhs 
)
friend

Compute the union with another alphabet.

Definition at line 240 of file setalpha.hh.

template<typename L>
template<typename L2 >
set_alphabet<L2> intersection ( const set_alphabet< L2 > &  lhs,
const set_alphabet< L2 > &  rhs 
)
friend

Compute the intersection with another alphabet.

Definition at line 232 of file setalpha.hh.

Member Data Documentation

template<typename L>
bool vcsn::set_alphabet< L >::open_ = false
mutableprivate

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