MCPcopy Create free account
hub / github.com/ablab/spades / array_set

Class array_set

ext/include/tsl/array-hash/array_set.h:69–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 class IndexSizeT = std::uint32_t,
68 class GrowthPolicy = tsl::ah::power_of_two_growth_policy<2>>
69class array_set {
70 private:
71 template <typename U>
72 using is_iterator = tsl::detail_array_hash::is_iterator<U>;
73
74 using ht = tsl::detail_array_hash::array_hash<CharT, void, Hash, KeyEqual,
75 StoreNullTerminator, KeySizeT,
76 IndexSizeT, GrowthPolicy>;
77
78 public:
79 using char_type = typename ht::char_type;
80 using key_size_type = typename ht::key_size_type;
81 using index_size_type = typename ht::index_size_type;
82 using size_type = typename ht::size_type;
83 using hasher = typename ht::hasher;
84 using key_equal = typename ht::key_equal;
85 using iterator = typename ht::iterator;
86 using const_iterator = typename ht::const_iterator;
87
88 array_set() : array_set(ht::DEFAULT_INIT_BUCKET_COUNT) {}
89
90 explicit array_set(size_type bucket_count, const Hash& hash = Hash())
91 : m_ht(bucket_count, hash, ht::DEFAULT_MAX_LOAD_FACTOR) {}
92
93 template <class InputIt, typename std::enable_if<
94 is_iterator<InputIt>::value>::type* = nullptr>
95 array_set(InputIt first, InputIt last,
96 size_type bucket_count = ht::DEFAULT_INIT_BUCKET_COUNT,
97 const Hash& hash = Hash())
98 : array_set(bucket_count, hash) {
99 insert(first, last);
100 }
101
102#ifdef TSL_AH_HAS_STRING_VIEW
103 array_set(std::initializer_list<std::basic_string_view<CharT>> init,
104 size_type bucket_count = ht::DEFAULT_INIT_BUCKET_COUNT,
105 const Hash& hash = Hash())
106 : array_set(bucket_count, hash) {
107 insert(init);
108 }
109#else
110 array_set(std::initializer_list<const CharT*> init,
111 size_type bucket_count = ht::DEFAULT_INIT_BUCKET_COUNT,
112 const Hash& hash = Hash())
113 : array_set(bucket_count, hash) {
114 insert(init);
115 }
116#endif
117
118#ifdef TSL_AH_HAS_STRING_VIEW
119 array_set& operator=(
120 std::initializer_list<std::basic_string_view<CharT>> ilist) {
121 clear();
122
123 reserve(ilist.size());
124 insert(ilist);
125
126 return *this;

Callers

nothing calls this directly

Calls 3

clearFunction · 0.50
insertClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected