|
cds
2.3.2
|
Metafunction converting option list to feldman_hashmap::traits.
More...
#include <cds/container/details/feldman_hashmap_base.h>
Public Types | |
| typedef implementation_defined | type |
| Metafunction result. | |
Metafunction converting option list to feldman_hashmap::traits.
Supported Options are:
opt::hash - a hash functor, default is std::hash 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
feldman_hashmap::hash_size - 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 ).
opt::allocator - item allocator Default is CDS_DEFAULT_ALLOCATORopt::node_allocator - array node allocator. Allocator for array nodes. The allocator is used for creating headNode and arrayNode when the set grows. Default is CDS_DEFAULT_ALLOCATORopt::compare - hash comparison functor. No default functor is provided. If the option is not specified, the opt::less is used.opt::less - specifies binary predicate used for hash comparison. 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.opt::back_off - back-off strategy used. If the option is not specified, the cds::backoff::Default is used.opt::item_counter - the type of item counting feature. 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
opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default) or opt::v::sequential_consistent (sequentially consisnent memory model).opt::stat - internal statistics. By default, it is disabled (feldman_hashmap::empty_stat). To enable it use feldman_hashmap::stat opt::rcu_check_deadlock - a deadlock checking policy for RCU-based FeldmanHashSet Default is opt::v::rcu_throw_deadlock