Go to the documentation of this file.
24 #ifndef TSL_ROBIN_SET_H
25 #define TSL_ROBIN_SET_H
29 #include <initializer_list>
31 #include <type_traits>
86 template <
class Key,
class Hash = std::hash<Key>,
87 class KeyEqual = std::equal_to<Key>,
88 class Allocator = std::allocator<Key>,
bool StoreHash = false,
89 class GrowthPolicy = tsl::rh::power_of_two_growth_policy<2>>
105 Allocator, StoreHash, GrowthPolicy>;
128 const KeyEqual& equal = KeyEqual(),
129 const Allocator& alloc = Allocator())
139 :
robin_set(
ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) {}
141 template <
class InputIt>
144 const Hash& hash = Hash(),
const KeyEqual& equal = KeyEqual(),
145 const Allocator& alloc = Allocator())
150 template <
class InputIt>
152 const Allocator& alloc)
155 template <
class InputIt>
157 const Hash& hash,
const Allocator& alloc)
162 const Hash& hash = Hash(),
const KeyEqual& equal = KeyEqual(),
163 const Allocator& alloc = Allocator())
167 const Allocator& alloc)
172 const Hash& hash,
const Allocator& alloc)
226 template <
class InputIt>
227 void insert(InputIt first, InputIt last) {
231 void insert(std::initializer_list<value_type> ilist) {
242 template <
class... Args>
243 std::pair<iterator, bool>
emplace(Args&&... args) {
254 template <
class... Args>
280 return m_ht.
erase(key, precalculated_hash);
289 class K,
class KE = KeyEqual,
290 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
303 class K,
class KE = KeyEqual,
304 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
306 return m_ht.
erase(key, precalculated_hash);
322 return m_ht.
count(key, precalculated_hash);
331 class K,
class KE = KeyEqual,
332 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
345 class K,
class KE = KeyEqual,
346 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
348 return m_ht.
count(key, precalculated_hash);
359 return m_ht.
find(key, precalculated_hash);
368 return m_ht.
find(key, precalculated_hash);
377 class K,
class KE = KeyEqual,
378 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
391 class K,
class KE = KeyEqual,
392 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
394 return m_ht.
find(key, precalculated_hash);
401 class K,
class KE = KeyEqual,
402 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
415 class K,
class KE = KeyEqual,
416 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
418 return m_ht.
find(key, precalculated_hash);
428 bool contains(
const Key& key, std::size_t precalculated_hash)
const {
438 class K,
class KE = KeyEqual,
439 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
452 class K,
class KE = KeyEqual,
453 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
454 bool contains(
const K& key, std::size_t precalculated_hash)
const {
468 std::size_t precalculated_hash) {
480 const Key& key, std::size_t precalculated_hash)
const {
490 class K,
class KE = KeyEqual,
491 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
504 class K,
class KE = KeyEqual,
505 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
507 std::size_t precalculated_hash) {
515 class K,
class KE = KeyEqual,
516 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
517 std::pair<const_iterator, const_iterator>
equal_range(
const K& key)
const {
525 class K,
class KE = KeyEqual,
526 typename std::enable_if<has_is_transparent<KE>::value>::type* =
nullptr>
528 const K& key, std::size_t precalculated_hash)
const {
583 for (
const auto& element_lhs : lhs) {
584 const auto it_element_rhs = rhs.
find(element_lhs);
585 if (it_element_rhs == rhs.
cend()) {
606 template <
class Serializer>
637 template <
class Deserializer>
639 bool hash_compatible =
false) {
660 template <
class Key,
class Hash = std::hash<Key>,
661 class KeyEqual = std::equal_to<Key>,
662 class Allocator = std::allocator<Key>,
bool StoreHash = false>
iterator begin() noexcept
typename ht::const_iterator const_iterator
bool contains(const Key &key) const
iterator find(const K &key, std::size_t precalculated_hash)
bool contains(const K &key, std::size_t precalculated_hash) const
void erase_fast(iterator pos)
float max_load_factor() const
bool contains(const K &key) const
const value_type * const_pointer
void reserve(size_type count_)
hasher hash_function() const
typename ht::reference reference
size_type size() const noexcept
const_iterator find(const Key &key) const
typename ht::const_pointer const_pointer
size_type erase(const key_type &key, std::size_t precalculated_hash)
float max_load_factor() const
robin_set(size_type bucket_count, const Hash &hash, const Allocator &alloc)
std::pair< iterator, bool > emplace(Args &&... args)
bool contains(const Key &key, std::size_t precalculated_hash) const
std::pair< iterator, iterator > equal_range(const Key &key, std::size_t precalculated_hash)
iterator insert(const_iterator hint, const value_type &value)
const_iterator find(const K &key, std::size_t precalculated_hash) const
iterator insert(const_iterator hint, value_type &&value)
typename ht::const_reference const_reference
std::pair< iterator, bool > insert(const value_type &value)
robin_set(InputIt first, InputIt last, size_type bucket_count, const Hash &hash, const Allocator &alloc)
std::pair< iterator, bool > emplace(Args &&... args)
typename ht::pointer pointer
std::ptrdiff_t difference_type
static robin_set deserialize(Deserializer &deserializer, bool hash_compatible=false)
bool empty() const noexcept
robin_set(size_type bucket_count, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
size_type erase(const key_type &key)
void serialize(Serializer &serializer) const
iterator erase(const_iterator first, const_iterator last)
size_type size() const noexcept
iterator emplace_hint(const_iterator hint, Args &&... args)
const_iterator cend() const noexcept
const key_type & operator()(const Key &key) const noexcept
typename ht::difference_type difference_type
hasher hash_function() const
typename ht::iterator iterator
std::pair< const_iterator, const_iterator > equal_range(const Key &key, std::size_t precalculated_hash) const
float min_load_factor() const
size_type erase(const K &key)
iterator erase(const_iterator pos)
iterator find(const K &key)
size_type max_size() const noexcept
size_type bucket_count() const
iterator insert_hint(const_iterator hint, P &&value)
void max_load_factor(float ml)
bool empty() const noexcept
std::pair< iterator, iterator > equal_range(const K &key, std::size_t precalculated_hash)
key_type & operator()(Key &key) noexcept
friend void swap(robin_set &lhs, robin_set &rhs)
iterator find(const K &key)
const_iterator cbegin() const noexcept
const_iterator find(const Key &key, std::size_t precalculated_hash) const
void rehash(size_type count_)
std::pair< const_iterator, const_iterator > equal_range(const K &key, std::size_t precalculated_hash) const
typename ht::size_type size_type
size_type count(const K &key) const
void rehash(size_type count_)
const_iterator find(const K &key) const
static const size_type DEFAULT_INIT_BUCKETS_SIZE
robin_set(const Allocator &alloc)
const_iterator cend() const noexcept
typename ht::key_equal key_equal
size_type count(const Key &key) const
robin_set(InputIt first, InputIt last, size_type bucket_count, const Allocator &alloc)
iterator erase(iterator pos)
iterator mutable_iterator(const_iterator pos)
allocator_type get_allocator() const
size_type count(const K &key) const
iterator erase(iterator pos)
bool contains(const K &key) const
iterator emplace_hint(const_iterator hint, Args &&... args)
void min_load_factor(float ml)
void reserve(size_type count_)
typename ht::key_type key_type
std::pair< const_iterator, const_iterator > equal_range(const Key &key) const
typename ht::value_type value_type
std::pair< const_iterator, const_iterator > equal_range(const K &key) const
robin_iterator< true > const_iterator
void swap(robin_hash &other)
void erase_fast(iterator pos)
ROSCPP_DECL void set(const std::string &key, bool b)
float min_load_factor() const
typename ht::allocator_type allocator_type
const_iterator cbegin() const noexcept
std::pair< iterator, iterator > equal_range(const Key &key)
typename ht::hasher hasher
robin_set(InputIt first, InputIt last, size_type bucket_count=ht::DEFAULT_INIT_BUCKETS_SIZE, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
size_type max_bucket_count() const
robin_set & operator=(std::initializer_list< value_type > ilist)
iterator find(const Key &key)
friend bool operator!=(const robin_set &lhs, const robin_set &rhs)
allocator_type get_allocator() const
void init(const M_string &remappings)
void insert(std::initializer_list< value_type > ilist)
iterator find(const Key &key, std::size_t precalculated_hash)
std::pair< iterator, iterator > equal_range(const K &key)
size_type max_bucket_count() const
size_type count(const Key &key, std::size_t precalculated_hash) const
friend bool operator==(const robin_set &lhs, const robin_set &rhs)
void insert(InputIt first, InputIt last)
std::pair< iterator, iterator > equal_range(const K &key)
detail_robin_hash::robin_hash< Key, KeySelect, void, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy > ht
robin_set(std::initializer_list< value_type > init, size_type bucket_count=ht::DEFAULT_INIT_BUCKETS_SIZE, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
size_type erase(const K &key, std::size_t precalculated_hash)
size_type max_size() const noexcept
float load_factor() const
robin_set(size_type bucket_count, const Allocator &alloc)
typename KeySelect::key_type key_type
const_iterator end() const noexcept
size_type bucket_count() const
iterator begin() noexcept
robin_iterator< false > iterator
size_type count(const K &key, std::size_t precalculated_hash) const
void serialize(Serializer &serializer) const
void swap(robin_set &other)
robin_set(std::initializer_list< value_type > init, size_type bucket_count, const Allocator &alloc)
std::pair< iterator, bool > insert(value_type &&value)
iterator mutable_iterator(const_iterator pos)
robin_set(std::initializer_list< value_type > init, size_type bucket_count, const Hash &hash, const Allocator &alloc)
std::pair< iterator, bool > insert(P &&value)
float load_factor() const
const value_type & const_reference
const_iterator begin() const noexcept
mp2p_icp
Author(s):
autogenerated on Fri Dec 20 2024 03:45:59