1 | #pragma once |
---|---|
2 | |
3 | #include <Common/HashTable/FixedHashTable.h> |
4 | |
5 | template <typename Key, typename Allocator = HashTableAllocator> |
6 | class FixedHashSet : public FixedHashTable<Key, FixedHashTableCell<Key>, Allocator> |
7 | { |
8 | public: |
9 | using Cell = FixedHashTableCell<Key>; |
10 | using Base = FixedHashTable<Key, Cell, Allocator>; |
11 | using Self = FixedHashSet; |
12 | |
13 | void merge(const Self & rhs) |
14 | { |
15 | for (size_t i = 0; i < Base::BUFFER_SIZE; ++i) |
16 | if (Base::buf[i].isZero(*this) && !rhs.buf[i].isZero(*this)) |
17 | new (&Base::buf[i]) Cell(rhs.buf[i]); |
18 | } |
19 | |
20 | /// NOTE: Currently this method isn't used. When it does, the ReadBuffer should |
21 | /// contain the Key explicitly. |
22 | // void readAndMerge(DB::ReadBuffer & rb) |
23 | // { |
24 | |
25 | // } |
26 | }; |
27 |