cds
2.3.2
|
FeldmanHashMap
traits
More...
#include <cds/container/details/feldman_hashmap_base.h>
Public Types | |
typedef opt::none | hash |
Hash functor, default is opt::none . More... | |
typedef cds::opt::none | hash_splitter |
Hash splitter. More... | |
typedef cds::opt::none | compare |
Hash comparing functor. More... | |
typedef cds::opt::none | less |
Specifies binary predicate used for hash compare. More... | |
typedef cds::atomicity::item_counter | item_counter |
Item counter. More... | |
typedef CDS_DEFAULT_ALLOCATOR | allocator |
Item allocator. More... | |
typedef CDS_DEFAULT_ALLOCATOR | node_allocator |
Array node allocator. More... | |
typedef cds::opt::v::relaxed_ordering | memory_model |
C++ memory ordering model. More... | |
typedef cds::backoff::Default | back_off |
Back-off strategy. | |
typedef empty_stat | stat |
Internal statistics. More... | |
typedef cds::opt::v::rcu_throw_deadlock | rcu_check_deadlock |
RCU deadlock checking policy (only for RCU-based FeldmanHashMap) More... | |
Static Public Attributes | |
static constexpr size_t const | hash_size = 0 |
The size of hash value in bytes. More... | |
FeldmanHashMap
traits
Item allocator.
Default is CDS_DEFAULT_ALLOCATOR
Hash comparing functor.
No default functor is provided. If the option is not specified, the less
option is used.
Hash functor, default is opt::none
.
FeldmanHashMap
may use any hash functor converting a key to fixed-sized bit-string, for example, SHA1, SHA2, MurmurHash, CityHash or its successor FarmHash.
If you use a fixed-sized key you can use it directly instead of a hash. In such case traits::hash
should be specified as opt::none
. However, if you want to use the hash values or if your key type is not fixed-sized you must specify a proper hash functor in your traits. For example: fixed-sized key - IP4 address map
variable-size key requires a hash functor: URL map
Hash splitter.
This trait specifies hash bit-string splitter algorithm. By default, cds::algo::number_splitter
is used if HashType
is a number, cds::algo::split_bitstring
otherwise.
Item counter.
The item counting is an important part of FeldmanHashSet
algorithm: the empty()
member function depends on correct item counting. Therefore, atomicity::empty_item_counter
is not allowed as a type of the option.
Default is atomicity::item_counter
. To avoid false sharing you can aldo use atomicity::cache_friendly_item_counter
Specifies binary predicate used for hash compare.
If less
and compare
are not specified, memcmp()
-like bit-wise hash comparator is used because the hash value is treated as fixed-sized bit-string.
C++ memory ordering model.
Can be opt::v::relaxed_ordering
(relaxed memory model, the default) or opt::v::sequential_consistent
(sequentially consisnent memory model).
Array node allocator.
Allocator for array nodes. The allocator is used for creating headNode
and arrayNode
when the set grows. Default is CDS_DEFAULT_ALLOCATOR
RCU deadlock checking policy (only for RCU-based FeldmanHashMap)
List of available policy see opt::rcu_check_deadlock
Internal statistics.
By default, internal statistics is disabled (feldman_hashset::empty_stat
). Use feldman_hashset::stat
to enable it.
|
static |
The size of hash value in bytes.
By default, the size of hash value is sizeof( hash_type )
where hash_type
is type of hash()
result or sizeof( key )
if you use fixed-sized key.
Sometimes that size is wrong, for example, for that 6-byte key:
Here sizeof( key_type ) == 8
so static_assert
will be thrown.
For that case you can specify hash_size
explicitly.
Value 0
means auto-calculated sizeof( key_type )
.