Vcsn  2.3
Be Rational
vcsn::detail::state_bimap< StateNameset, Stateset, true > Class Template Reference

A bidirectional map from state names to state numbers. More...

#include <state-bimap.hh>

Collaboration diagram for vcsn::detail::state_bimap< StateNameset, Stateset, true >:

Public Types

using state_nameset_t = StateNameset
 
using state_name_t = typename state_nameset_t::value_t
 
using stateset_t = Stateset
 
using state_t = typename stateset_t::value_t
 
using left_t = boost::bimaps::unordered_set_of< state_name_t, vcsn::hash< state_nameset_t >, vcsn::equal_to< state_nameset_t >>
 Storage for state names. More...
 
using right_t = boost::bimaps::set_of< state_t >
 Storage for state index. More...
 
using bimap_t = boost::bimap< left_t, right_t >
 Bidirectional map state_name_t -> state_t;. More...
 
using const_iterator = typename bimap_t::const_iterator
 
using origins_t = typename bimap_t::right_map
 A map from state indexes to state names. More...
 

Public Member Functions

template<typename... Args>
auto emplace (Args &&...args)
 Insert a new state. More...
 
auto find_key (const state_name_t &s) const
 
auto end_key () const
 
const origins_torigins () const
 

Static Public Member Functions

static const state_name_tstate_name (const const_iterator &i)
 Get the state name from a const_iterator. More...
 
static state_t state (const const_iterator &i)
 Get the state from a const_iterator. More...
 

Private Attributes

bimap_t map_
 

Detailed Description

template<typename StateNameset, typename Stateset>
class vcsn::detail::state_bimap< StateNameset, Stateset, true >

A bidirectional map from state names to state numbers.

The lazy case: maintain the origins() map constantly.

Template Parameters
StateNameseta valueset to manipulate the state names.
Stateseta valueset to manipulate the state indexes.

Definition at line 32 of file state-bimap.hh.

Member Typedef Documentation

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::bimap_t = boost::bimap<left_t, right_t>

Bidirectional map state_name_t -> state_t;.

Definition at line 49 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::const_iterator = typename bimap_t::const_iterator

Definition at line 51 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::left_t = boost::bimaps::unordered_set_of<state_name_t, vcsn::hash<state_nameset_t>, vcsn::equal_to<state_nameset_t>>

Storage for state names.

Definition at line 45 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::origins_t = typename bimap_t::right_map

A map from state indexes to state names.

Definition at line 85 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::right_t = boost::bimaps::set_of<state_t>

Storage for state index.

Definition at line 47 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::state_name_t = typename state_nameset_t::value_t

Definition at line 36 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::state_nameset_t = StateNameset

Definition at line 35 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::state_t = typename stateset_t::value_t

Definition at line 39 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
using vcsn::detail::state_bimap< StateNameset, Stateset, true >::stateset_t = Stateset

Definition at line 38 of file state-bimap.hh.

Member Function Documentation

template<typename StateNameset , typename Stateset >
template<typename... Args>
auto vcsn::detail::state_bimap< StateNameset, Stateset, true >::emplace ( Args &&...  args)
inline

Insert a new state.

Pass a "pair" state-name -> state.

Definition at line 57 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
auto vcsn::detail::state_bimap< StateNameset, Stateset, true >::end_key ( ) const
inline

Definition at line 67 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
auto vcsn::detail::state_bimap< StateNameset, Stateset, true >::find_key ( const state_name_t s) const
inline

Definition at line 62 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
const origins_t& vcsn::detail::state_bimap< StateNameset, Stateset, true >::origins ( ) const
inline

Definition at line 86 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
static state_t vcsn::detail::state_bimap< StateNameset, Stateset, true >::state ( const const_iterator i)
inlinestatic

Get the state from a const_iterator.

Definition at line 79 of file state-bimap.hh.

template<typename StateNameset , typename Stateset >
static const state_name_t& vcsn::detail::state_bimap< StateNameset, Stateset, true >::state_name ( const const_iterator i)
inlinestatic

Get the state name from a const_iterator.

Definition at line 73 of file state-bimap.hh.

Member Data Documentation

template<typename StateNameset , typename Stateset >
bimap_t vcsn::detail::state_bimap< StateNameset, Stateset, true >::map_
private

Definition at line 92 of file state-bimap.hh.


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