cds
2.3.2
|
FeldmanHashSet
traits
More...
#include <cds/intrusive/details/feldman_hashset_base.h>
Public Types | |
typedef cds::opt::none | hash_accessor |
Mandatory functor to get hash value from data node. More... | |
typedef cds::opt::none | hash_splitter |
Hash splitter. More... | |
typedef cds::intrusive::opt::v::empty_disposer | disposer |
Disposer for removing data nodes. | |
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 | 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 FeldmanHashSet) More... | |
Static Public Attributes | |
static constexpr size_t const | hash_size = 0 |
The size of hash value in bytes. More... | |
FeldmanHashSet
traits
Hash comparing functor.
No default functor is provided. If the option is not specified, the less
option is used.
Mandatory functor to get hash value from data node.
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:
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 FeldmanHashSet)
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 )
. Sometimes it is not correct, for example, for that 6-byte struct static_assert
will be thrown:
For that case you can specify hash_size
explicitly.
Value 0
means sizeof( hash_type )
.