smats  0.0.1
Satisfability Modulo Arithmetic Theories Symbols
Loading...
Searching...
No Matches
smats::DelegatingHasher Struct Reference

#include <hash.hpp>

Public Types

using Func = std::function<void(const void*, size_t)>
 
using result_type = typename DefaultHashAlgorithm::result_type
 Necessary to be accepted by hash_append.
 

Public Member Functions

 DelegatingHasher (Func func)
 
void operator() (const void *data, size_t length) noexcept
 
 operator result_type () noexcept
 

Private Attributes

const Func func_
 Concrete hash algorithm implementation.
 

Detailed Description

A simple struct that wraps a specific hash algorithm into a std::function. It is useful for passing a concrete HashAlgorithm implementation through into non-templated code.

See also
ExpressionCell::hash

Constructor & Destructor Documentation

◆ DelegatingHasher()

smats::DelegatingHasher::DelegatingHasher ( Func func)
inlineexplicit

Construct a new DelegatingHasher object.

Precondition
The function must be non-empty.
Parameters
funchash algorithm implementation

Member Function Documentation

◆ operator result_type()

smats::DelegatingHasher::operator result_type ( )
inlinenoexcept

Placeholder for the return type.

It is necessary for this struct to correctly implement the Hashable concept.

Warning
This function should never be called.

◆ operator()()

void smats::DelegatingHasher::operator() ( const void * data,
size_t length )
inlinenoexcept

Delegation of the hash algorithm to func_ .

Parameters
datadata to hash
lengthlength of the data

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