Vcsn  2.2
Be Rational
wet.hh File Reference
#include <cassert>
#include <map>
#include <set>
#include <type_traits>
#include <unordered_map>
#include <boost/iterator/iterator_facade.hpp>
#include <vcsn/ctx/traits.hh>
#include <vcsn/misc/builtins.hh>
#include <vcsn/misc/dynamic_bitset.hh>
#include <vcsn/misc/empty.hh>
#include <vcsn/misc/functional.hh>
#include <vcsn/misc/type_traits.hh>
Include dependency graph for wet.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  vcsn::detail::welement_label< Label >
 Storage for a label. More...
 
struct  vcsn::detail::welement_label< empty_t >
 Storage for a label in the case of the empty labelset. More...
 
struct  vcsn::detail::welement_weight< Weight >
 Storage for a non-null weight. More...
 
struct  vcsn::detail::welement_weight< bool >
 Storage for a non-null single-bit weight: don't actually store anything. More...
 
struct  vcsn::welement< Label, Weight >
 Storage for a label and a non-null weight. More...
 
class  vcsn::detail::wet_map< Key, Value, Compare >
 Weighted set: general, ordered, case. More...
 
class  vcsn::detail::wet_unordered_map< Key, Value, Hash, KeyEqual >
 Weighted set: general, unordered, case. More...
 
class  vcsn::detail::wet_set< Key, Compare >
 Weighted set: weights are bools. More...
 
struct  vcsn::detail::wet_set< Key, Compare >::iterator_impl< Value, Iterator >
 Iterator. More...
 
class  vcsn::detail::wet_bitset
 Weighted set: labels are non-negative integers, weights are bools. More...
 
struct  vcsn::detail::wet_bitset::iterator_impl< Value, Set >
 Iterator. More...
 
struct  vcsn::detail::wet_kind_impl< Key, Value >
 wet_impl<Key, Value>: map. More...
 
struct  vcsn::detail::wet_kind_impl< Key, bool >
 wet_impl<Key, bool>: set. More...
 
struct  vcsn::detail::wet_kind_impl< char, bool >
 wet_impl<char, bool>: bitsets. More...
 

Namespaces

 vcsn
 
 vcsn::detail
 

Macros

#define DEFINE(K)   case wet_kind_t::K: return "vcsn::wet_kind_t::" #K
 
#define DEFINE(Name, Const)
 
#define DEFINE(Name, Const)
 
#define DEFINE(Name, Const)
 

Typedefs

template<wet_kind_t Kind, typename Key , typename Value , typename Compare , typename Hash , typename KeyEqual >
using vcsn::detail::wet_impl = std::conditional_t< Kind==wet_kind_t::bitset, wet_bitset, std::conditional_t< Kind==wet_kind_t::set, wet_set< Key, Compare >, std::conditional_t< Kind==wet_kind_t::map, wet_map< Key, Value, Compare >, std::conditional_t< Kind==wet_kind_t::unordered_map, wet_unordered_map< Key, Value, Hash, KeyEqual >, void > > > >
 A weighted set type from its kind. More...
 
template<typename Key , typename Value , wet_kind_t Kind = detail::wet_kind<Key, Value>(), typename Compare = std::less<Key>, typename Hash = std::hash<Key>, typename KeyEqual = std::equal_to<Key>>
using vcsn::wet = detail::wet_impl< Kind, Key, Value, Compare, Hash, KeyEqual >
 Given Key/Value types, the appropriate weighted set type. More...
 
template<typename Context , wet_kind_t Kind = detail::wet_kind<labelset_t_of<Context>, weightset_t_of<Context>>()>
using vcsn::wet_of = wet< label_t_of< Context >, weight_t_of< Context >, Kind, vcsn::less< labelset_t_of< Context >>, vcsn::hash< labelset_t_of< Context >>, vcsn::equal_to< labelset_t_of< Context >>>
 The corresponding wet for a LabelSet -> WeightSet context. More...
 

Enumerations

enum  vcsn::wet_kind_t { vcsn::wet_kind_t::bitset, vcsn::wet_kind_t::map, vcsn::wet_kind_t::set, vcsn::wet_kind_t::unordered_map }
 Different implementations of wets. More...
 

Functions

template<typename Label , typename Weight >
auto vcsn::label_of (const welement< Label, Weight > &m) -> decltype(m.label())
 The label of a welement. More...
 
template<typename Label , typename Weight >
auto vcsn::weight_of (const welement< Label, Weight > &m) -> decltype(m.weight())
 The weight of a welement. More...
 
template<typename Label , typename Weight >
void vcsn::weight_set (welement< Label, Weight > &m, const Weight &w)
 Set the weight of a welement. More...
 
template<typename Label , typename Weight >
const Label & vcsn::label_of (const std::pair< Label, Weight > &m)
 The label of a pair (label, weight). More...
 
template<typename Label , typename Weight >
const Weight & vcsn::weight_of (const std::pair< Label, Weight > &m)
 The weight of a pair (label, weight). More...
 
template<typename Label , typename Weight >
Label & vcsn::label_of (std::pair< Label, Weight > &m)
 The label of a pair (label, weight). More...
 
template<typename Label , typename Weight >
void vcsn::weight_set (std::pair< Label, Weight > &m, const Weight &w)
 Set the weight of a pair (label, weight). More...
 
std::string vcsn::to_string (wet_kind_t k)
 String version of a wet kind. More...
 
template<typename Key , typename Value >
constexpr wet_kind_t vcsn::detail::wet_kind ()
 Given a Key and a Value type, the appropriate weighted set type. More...
 

Macro Definition Documentation

#define DEFINE (   K)    case wet_kind_t::K: return "vcsn::wet_kind_t::" #K

Definition at line 523 of file wet.hh.

Referenced by vcsn::to_string().

#define DEFINE (   Name,
  Const 
)
Value:
template <typename... Args> \
auto \
Name(Args&&... args) Const \
-> decltype(map_.Name(std::forward<Args>(args)...)) \
{ \
return map_.Name(std::forward<Args>(args)...); \
}
STL namespace.

Definition at line 523 of file wet.hh.

#define DEFINE (   Name,
  Const 
)
Value:
template <typename... Args> \
auto \
Name(Args&&... args) Const \
-> decltype(map_.Name(std::forward<Args>(args)...)) \
{ \
return map_.Name(std::forward<Args>(args)...); \
}
STL namespace.

Definition at line 523 of file wet.hh.

#define DEFINE (   Name,
  Const 
)
Value:
template <typename... Args> \
auto \
Name(Args&&... args) Const \
-> decltype(set_.Name(std::forward<Args>(args)...)) \
{ \
return set_.Name(std::forward<Args>(args)...); \
}
STL namespace.

Definition at line 523 of file wet.hh.