mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
23 lines
286 B
C++
23 lines
286 B
C++
#pragma once
|
|
|
|
#include <base/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;
|
|
}
|
|
};
|