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

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

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

Public Types

typedef implementation_defined type
 Metafunction result.
 

Detailed Description

template<typename... Options>
struct cds::container::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 ).

Default is atomicity::item_counter. To avoid false sharing you can aldo use atomicity::cache_friendly_item_counter


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:32 by Doxygen 1.8.13