Vcsn  2.2
Be Rational
vcsn::rat::hash< ExpSet > Class Template Reference

#include <hash.hh>

Inheritance diagram for vcsn::rat::hash< ExpSet >:
Collaboration diagram for vcsn::rat::hash< ExpSet >:

Classes

struct  visit_tuple
 
struct  visit_tuple< false, Dummy >
 

Public Types

using expressionset_t = ExpSet
 
using context_t = context_t_of< expressionset_t >
 
using weight_t = typename context_t::weightset_t::value_t
 
using super_t = typename expressionset_t::const_visitor
 
using node_t = typename super_t::node_t
 
using inner_t = typename super_t::inner_t
 
template<type_t Type>
using variadic_t = typename super_t::template variadic_t< Type >
 
template<type_t Type>
using unary_t = typename super_t::template unary_t< Type >
 
template<type_t Type>
using weight_node_t = typename super_t::template weight_node_t< Type >
 
using leaf_t = typename super_t::leaf_t
 

Public Member Functions

size_t operator() (const node_t &v)
 Entry point: return the hash of v. More...
 
size_t operator() (const std::shared_ptr< const node_t > &v)
 Entry point: return the hash of v. More...
 

Static Public Member Functions

static constexpr const charme ()
 Name of this algorithm, for error messages. More...
 

Private Types

using tuple_t = typename super_t::tuple_t
 

Private Member Functions

 VCSN_RAT_VISIT (atom, v)
 
 VCSN_RAT_VISIT (complement, v)
 
 VCSN_RAT_VISIT (conjunction, v)
 
 VCSN_RAT_VISIT (infiltration, v)
 
 VCSN_RAT_VISIT (ldiv, v)
 
 VCSN_RAT_VISIT (lweight, v)
 
 VCSN_RAT_VISIT (one, v)
 
 VCSN_RAT_VISIT (prod, v)
 
 VCSN_RAT_VISIT (rweight, v)
 
 VCSN_RAT_VISIT (shuffle, v)
 
 VCSN_RAT_VISIT (star, v)
 
 VCSN_RAT_VISIT (sum, v)
 
 VCSN_RAT_VISIT (transposition, v)
 
 VCSN_RAT_VISIT (zero, v)
 
void visit (const tuple_t &v, std::true_type) override
 
void combine_type (const node_t &node)
 Update res_ by hashing the node type; this is needed for any node. More...
 
void visit_nullary (const node_t &v)
 Traverse a nullary node (atom, \z, \e). More...
 
template<rat::exp::type_t Type>
void visit_unary (const unary_t< Type > &v)
 Traverse a unary node (*, {c}). More...
 
template<rat::exp::type_t Type>
void visit_variadic (const variadic_t< Type > &v)
 Traverse an n-ary node (+, concatenation, &, :). More...
 
template<rat::exp::type_t Type>
void visit_weight_node (const weight_node_t< Type > &v)
 Traverse a weight node (lweight, rweight). More...
 

Private Attributes

size_t res_
 

Detailed Description

template<typename ExpSet>
class vcsn::rat::hash< ExpSet >

Definition at line 10 of file hash.hh.

Member Typedef Documentation

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::context_t = context_t_of<expressionset_t>

Definition at line 15 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::expressionset_t = ExpSet

Definition at line 14 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::inner_t = typename super_t::inner_t

Definition at line 19 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::leaf_t = typename super_t::leaf_t

Definition at line 26 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::node_t = typename super_t::node_t

Definition at line 18 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::super_t = typename expressionset_t::const_visitor

Definition at line 17 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::tuple_t = typename super_t::tuple_t
private

Definition at line 64 of file hash.hh.

template<typename ExpSet >
template<type_t Type>
using vcsn::rat::hash< ExpSet >::unary_t = typename super_t::template unary_t<Type>

Definition at line 23 of file hash.hh.

template<typename ExpSet >
template<type_t Type>
using vcsn::rat::hash< ExpSet >::variadic_t = typename super_t::template variadic_t<Type>

Definition at line 21 of file hash.hh.

template<typename ExpSet >
template<type_t Type>
using vcsn::rat::hash< ExpSet >::weight_node_t = typename super_t::template weight_node_t<Type>

Definition at line 25 of file hash.hh.

template<typename ExpSet >
using vcsn::rat::hash< ExpSet >::weight_t = typename context_t::weightset_t::value_t

Definition at line 16 of file hash.hh.

Member Function Documentation

template<typename ExpSet >
void vcsn::rat::hash< ExpSet >::combine_type ( const node_t node)
inlineprivate

Update res_ by hashing the node type; this is needed for any node.

Definition at line 38 of file hash.hxx.

References vcsn::hash_combine().

Here is the call graph for this function:

template<typename ExpSet >
static constexpr const char* vcsn::rat::hash< ExpSet >::me ( )
inlinestatic

Name of this algorithm, for error messages.

Definition at line 29 of file hash.hh.

template<typename ExpSet >
size_t vcsn::rat::hash< ExpSet >::operator() ( const node_t v)
inline

Entry point: return the hash of v.

Definition at line 33 of file hash.hh.

References vcsn::rat::hash< ExpSet >::res_.

Referenced by vcsn::rat::hash< ExpSet >::operator()().

template<typename ExpSet >
size_t vcsn::rat::hash< ExpSet >::operator() ( const std::shared_ptr< const node_t > &  v)
inline

Entry point: return the hash of v.

Definition at line 42 of file hash.hh.

References vcsn::rat::hash< ExpSet >::operator()().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( atom  ,
 
)
private
template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( complement  ,
 
)
inlineprivate

Definition at line 50 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_unary().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( conjunction  ,
 
)
inlineprivate

Definition at line 51 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_variadic().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( infiltration  ,
 
)
inlineprivate

Definition at line 52 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_variadic().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( ldiv  ,
 
)
inlineprivate

Definition at line 53 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_variadic().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( lweight  ,
 
)
private
template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( one  ,
 
)
inlineprivate

Definition at line 55 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_nullary().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( prod  ,
 
)
inlineprivate

Definition at line 56 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_variadic().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( rweight  ,
 
)
private
template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( shuffle  ,
 
)
inlineprivate

Definition at line 58 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_variadic().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( star  ,
 
)
inlineprivate

Definition at line 59 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_unary().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( sum  ,
 
)
inlineprivate

Definition at line 60 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_variadic().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( transposition  ,
 
)
inlineprivate

Definition at line 61 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_unary().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT ( zero  ,
 
)
inlineprivate

Definition at line 62 of file hash.hh.

References vcsn::detail::v, and vcsn::rat::hash< ExpSet >::visit_nullary().

Here is the call graph for this function:

template<typename ExpSet >
auto vcsn::rat::hash< ExpSet >::visit ( const tuple_t v,
std::true_type   
)
inlineoverrideprivate

Definition at line 86 of file hash.hh.

References vcsn::rat::hash< ExpSet >::res_, and vcsn::detail::v.

template<typename ExpSet >
void vcsn::rat::hash< ExpSet >::visit_nullary ( const node_t v)
inlineprivate

Traverse a nullary node (atom, \z, \e).

Definition at line 46 of file hash.hxx.

Referenced by vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT().

template<typename ExpSet >
template<type_t Type>
void vcsn::rat::hash< ExpSet >::visit_unary ( const unary_t< Type > &  v)
inlineprivate

Traverse a unary node (*, {c}).

Definition at line 55 of file hash.hxx.

Referenced by vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT().

template<typename ExpSet >
template<type_t Type>
void vcsn::rat::hash< ExpSet >::visit_variadic ( const variadic_t< Type > &  v)
inlineprivate

Traverse an n-ary node (+, concatenation, &, :).

Definition at line 76 of file hash.hxx.

Referenced by vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT().

template<typename ExpSet >
template<type_t Type>
void vcsn::rat::hash< ExpSet >::visit_weight_node ( const weight_node_t< Type > &  v)
inlineprivate

Traverse a weight node (lweight, rweight).

Definition at line 65 of file hash.hxx.

References vcsn::hash_combine().

Here is the call graph for this function:

Member Data Documentation

template<typename ExpSet >
size_t vcsn::rat::hash< ExpSet >::res_
private

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