mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
25 lines
342 B
C++
25 lines
342 B
C++
#pragma once
|
|
|
|
#include <common/types.h>
|
|
#include <atomic>
|
|
|
|
|
|
/** Is used for numbering of files.
|
|
*/
|
|
struct SimpleIncrement
|
|
{
|
|
std::atomic<UInt64> value;
|
|
|
|
SimpleIncrement(UInt64 start = 0) : value(start) {}
|
|
|
|
void set(UInt64 new_value)
|
|
{
|
|
value = new_value;
|
|
}
|
|
|
|
UInt64 get()
|
|
{
|
|
return ++value;
|
|
}
|
|
};
|