ClickHouse/src/Common/SimpleIncrement.h
2020-12-21 10:48:15 +03:00

23 lines
288 B
C++

#pragma once
#include <common/types.h>
#include <atomic>
/** Is used for numbering of files.
*/
struct SimpleIncrement
{
std::atomic<UInt64> value{0};
void set(UInt64 new_value)
{
value = new_value;
}
UInt64 get()
{
return ++value;
}
};