mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
27 lines
765 B
C++
27 lines
765 B
C++
#pragma once
|
|
|
|
#include <Common/HashTable/FixedHashTable.h>
|
|
|
|
template <typename Key, typename Allocator = HashTableAllocator>
|
|
class FixedHashSet : public FixedHashTable<Key, FixedHashTableCell<Key>, Allocator>
|
|
{
|
|
public:
|
|
using Cell = FixedHashTableCell<Key>;
|
|
using Base = FixedHashTable<Key, Cell, Allocator>;
|
|
using Self = FixedHashSet;
|
|
|
|
void merge(const Self & rhs)
|
|
{
|
|
for (size_t i = 0; i < Base::BUFFER_SIZE; ++i)
|
|
if (Base::buf[i].isZero(*this) && !rhs.buf[i].isZero(*this))
|
|
new (&Base::buf[i]) Cell(rhs.buf[i]);
|
|
}
|
|
|
|
/// NOTE: Currently this method isn't used. When it does, the ReadBuffer should
|
|
/// contain the Key explicitly.
|
|
// void readAndMerge(DB::ReadBuffer & rb)
|
|
// {
|
|
|
|
// }
|
|
};
|