ModErn Text Analysis
META Enumerates Textual Applications
probe_set.h
Go to the documentation of this file.
1 
10 #ifndef META_HASHING_PROBE_SET_H_
11 #define META_HASHING_PROBE_SET_H_
12 
13 #include "meta/config.h"
14 #include "meta/hashing/hash.h"
16 #include "meta/hashing/probing.h"
17 
18 namespace meta
19 {
20 namespace hashing
21 {
22 
40 template <class Key, class ProbingStrategy = probing::binary,
41  class Hash = hash<>, class KeyEqual = std::equal_to<Key>,
42  class Traits = hash_traits<Key>>
43 class probe_set
44  : private Traits::template storage_type<ProbingStrategy, Hash, KeyEqual>
45 {
46  public:
47  using storage_type =
48  typename Traits::template storage_type<ProbingStrategy, Hash, KeyEqual>;
49 
50  using typename storage_type::iterator;
51  using typename storage_type::const_iterator;
52 
53  using storage_type::default_max_load_factor;
54  using storage_type::default_resize_ratio;
55 
56  using storage_type::storage_type;
57  using storage_type::begin;
58  using storage_type::end;
59  using storage_type::max_load_factor;
60  using storage_type::resize_ratio;
61  using storage_type::emplace;
62  using storage_type::find;
63  using storage_type::empty;
64  using storage_type::next_load_factor;
65  using storage_type::next_size;
66  using storage_type::size;
67  using storage_type::capacity;
68  using storage_type::clear;
70  using storage_type::extract_keys;
71 
72  probe_set() : storage_type{8}
73  {
74  // nothing
75  }
76 
81  iterator insert(const Key& key)
82  {
83  return emplace(key);
84  }
85 };
86 }
87 }
88 #endif
uint64_t bytes_used(const T &elem, typename std::enable_if< std::is_same< T, std::string >::value >::type *=nullptr)
Gets the bytes used by a std::string.
Definition: postings_buffer.h:33
An insert-only probing hash set.
Definition: probe_set.h:43
iterator insert(const Key &key)
Definition: probe_set.h:81
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retrieval, data mining, and other applications of text processing.
Definition: analyzer.h:25