mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
MultiVersion: add ctor, set from unique_ptr
This commit is contained in:
parent
49318b6cc5
commit
2435af6e31
@ -47,6 +47,11 @@ public:
|
||||
set(std::move(value));
|
||||
}
|
||||
|
||||
MultiVersion(std::unique_ptr<T> && value)
|
||||
{
|
||||
set(std::move(value));
|
||||
}
|
||||
|
||||
/// Получить текущую версию для использования. Возвращает shared_ptr, который определяет время жизни версии.
|
||||
const Version get() const
|
||||
{
|
||||
@ -68,6 +73,11 @@ public:
|
||||
set(Version(value));
|
||||
}
|
||||
|
||||
void set(std::unique_ptr<T> && value)
|
||||
{
|
||||
set(Version(value.release()));
|
||||
}
|
||||
|
||||
private:
|
||||
Version current_version;
|
||||
mutable std::mutex mutex;
|
||||
|
Loading…
Reference in New Issue
Block a user