cds  2.3.2
cds::intrusive::feldman_hashset::make_traits< Options > Struct Template Reference

Metafunction converting option list to feldman_hashset::traits. More...

#include <cds/intrusive/details/feldman_hashset_base.h>

Public Types

typedef implementation_defined type
 Metafunction result.
 

Detailed Description

template<typename... Options>
struct cds::intrusive::feldman_hashset::make_traits< Options >

Metafunction converting option list to feldman_hashset::traits.

Supported Options are:

  • feldman_hashset::hash_accessor - mandatory option, hash accessor functor. It is most-important feature of FeldmanHashSet. That functor must return a reference to fixed-sized hash value of data node. The return value of that functor specifies the type of hash value.

Example:

typedef uint8_t hash_type[32]; // 256-bit hash type
struct foo {
hash_type hash; // 256-bit hash value
// ... other fields
};
// Hash accessor
struct foo_hash_accessor {
hash_type const& operator()( foo const& d ) const
{
return d.hash;
}
};
  • feldman_hashset::hash_size - the size of hash value in bytes. By default, the size of hash value is sizeof( hash_type ). Sometimes it is not correct, for example, for that 6-byte struct static_assert will be thrown:
    struct key_type {
    uint32_t key1;
    uint16_t subkey;
    };
    static_assert( sizeof( key_type ) == 6, "Key type size mismatch" );
    For that case you can specify hash_size explicitly.

Value 0 means sizeof( hash_type ).


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

cds 2.3.2 Developed by Maxim Khizhinsky aka khizmax and other contributors 2007 - 2017
Autogenerated Sun Dec 31 2017 12:10:43 by Doxygen 1.8.13