Vcsn  2.4
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
 

Public Types

using expressionset_t = ExpSet
 
using context_t = context_t_of< expressionset_t >
 
using super_t = typename expressionset_t::const_visitor
 
using node_t = typename super_t::node_t
 Actual node, without indirection. More...
 
using expression_t = typename node_t::value_t
 A shared_ptr to node_t. More...
 
template<type_t Type>
using constant_t = typename super_t::template constant_t< Type >
 
template<type_t Type>
using unary_t = typename super_t::template unary_t< Type >
 
template<type_t Type>
using variadic_t = typename super_t::template variadic_t< Type >
 
template<type_t Type>
using weight_node_t = typename super_t::template weight_node_t< Type >
 

Public Member Functions

size_t operator() (const expression_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

void combine_ (size_t h)
 Update res_ with the hash. More...
 
void combine_type_ (const node_t &node)
 Update res_ by hashing the node type. More...
 
 VCSN_RAT_VISIT (add, v)
 
 VCSN_RAT_VISIT (complement, v)
 
 VCSN_RAT_VISIT (compose, v)
 
 VCSN_RAT_VISIT (conjunction, v)
 
 VCSN_RAT_VISIT (infiltrate, v)
 
 VCSN_RAT_VISIT (ldivide, v)
 
 VCSN_RAT_VISIT (lweight, v)
 
 VCSN_RAT_VISIT (mul, v)
 
 VCSN_RAT_VISIT (one, v)
 
 VCSN_RAT_VISIT (rweight, v)
 
 VCSN_RAT_VISIT (shuffle, v)
 
 VCSN_RAT_VISIT (star, v)
 
 VCSN_RAT_VISIT (transposition, v)
 
 VCSN_RAT_VISIT (zero, v)
 
 VCSN_RAT_VISIT (atom, v)
 
void visit (const tuple_t &v, std::true_type) override
 
template<rat::exp::type_t Type>
void visit_ (const constant_t< Type > &v)
 Traverse a nullary node. More...
 
template<rat::exp::type_t Type>
void visit_ (const unary_t< Type > &v)
 Traverse a unary node. More...
 
template<rat::exp::type_t Type>
void visit_ (const variadic_t< Type > &v)
 Traverse an n-ary node. More...
 
template<rat::exp::type_t Type>
void visit_ (const weight_node_t< Type > &v)
 Traverse a weight node (lweight, rweight). More...
 

Private Attributes

size_t res_
 The result, which must be updated incrementally. More...
 

Detailed Description

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

Definition at line 10 of file hash.hh.

Member Typedef Documentation

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

Definition at line 24 of file hash.hh.

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 >::expression_t = typename node_t::value_t

A shared_ptr to node_t.

Definition at line 21 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 >::node_t = typename super_t::node_t

Actual node, without indirection.

Definition at line 19 of file hash.hh.

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

Definition at line 16 of file hash.hh.

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

Definition at line 79 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 26 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 28 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 30 of file hash.hh.

Member Function Documentation

template<typename ExpSet >
void vcsn::rat::hash< ExpSet >::combine_ ( size_t  h)
inlineprivate

Update res_ with the hash.

Definition at line 46 of file hash.hh.

References vcsn::hash_combine(), and vcsn::rat::hash< ExpSet >::res_.

Referenced by vcsn::rat::hash< ExpSet >::combine_type_(), vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT(), vcsn::rat::hash< ExpSet >::visit(), and vcsn::rat::hash< ExpSet >::visit_().

Here is the call graph for this function:

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

Update res_ by hashing the node type.

Must be for every node.

Definition at line 53 of file hash.hh.

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

Referenced by vcsn::rat::hash< ExpSet >::VCSN_RAT_VISIT(), vcsn::rat::hash< ExpSet >::visit(), and vcsn::rat::hash< ExpSet >::visit_().

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 33 of file hash.hh.

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

Entry point: return the hash of v.

Definition at line 36 of file hash.hh.

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

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

Definition at line 58 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 59 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 60 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 61 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 62 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 63 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 64 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 65 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 66 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 67 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 68 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 69 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 70 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 71 of file hash.hh.

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

Here is the call graph for this function:

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

Definition at line 73 of file hash.hh.

References vcsn::rat::hash< ExpSet >::combine_(), vcsn::rat::hash< ExpSet >::combine_type_(), and vcsn::v.

Here is the call graph for this function:

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

Definition at line 91 of file hash.hh.

References vcsn::rat::hash< ExpSet >::combine_(), vcsn::rat::hash< ExpSet >::combine_type_(), and vcsn::v.

Here is the call graph for this function:

template<typename ExpSet >
template<rat::exp::type_t Type>
void vcsn::rat::hash< ExpSet >::visit_ ( const constant_t< Type > &  v)
inlineprivate

Traverse a nullary node.

Definition at line 104 of file hash.hh.

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

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

Here is the call graph for this function:

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

Traverse a unary node.

Definition at line 111 of file hash.hh.

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

Here is the call graph for this function:

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

Traverse an n-ary node.

Definition at line 119 of file hash.hh.

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

Here is the call graph for this function:

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

Traverse a weight node (lweight, rweight).

Definition at line 128 of file hash.hh.

References vcsn::rat::hash< ExpSet >::combine_(), and vcsn::rat::hash< ExpSet >::combine_type_().

Here is the call graph for this function:

Member Data Documentation

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

The result, which must be updated incrementally.

Do not modify directly, call combine_ instead.

Definition at line 137 of file hash.hh.

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


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