2019-04-18 23:29:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Core/Field.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-09-15 18:06:20 +00:00
|
|
|
|
|
|
|
class IColumn;
|
|
|
|
|
2019-04-18 23:29:32 +00:00
|
|
|
struct SettingChange
|
|
|
|
{
|
|
|
|
String name;
|
|
|
|
Field value;
|
2020-04-17 19:54:53 +00:00
|
|
|
|
2022-03-11 21:47:28 +00:00
|
|
|
SettingChange() = default;
|
2020-07-22 12:02:47 +00:00
|
|
|
SettingChange(const std::string_view & name_, const Field & value_) : name(name_), value(value_) {}
|
|
|
|
SettingChange(const std::string_view & name_, Field && value_) : name(name_), value(std::move(value_)) {}
|
2019-10-30 21:37:28 +00:00
|
|
|
|
|
|
|
friend bool operator ==(const SettingChange & lhs, const SettingChange & rhs) { return (lhs.name == rhs.name) && (lhs.value == rhs.value); }
|
|
|
|
friend bool operator !=(const SettingChange & lhs, const SettingChange & rhs) { return !(lhs == rhs); }
|
2019-04-18 23:29:32 +00:00
|
|
|
};
|
|
|
|
|
2020-07-22 12:02:47 +00:00
|
|
|
|
|
|
|
class SettingsChanges : public std::vector<SettingChange>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using std::vector<SettingChange>::vector;
|
|
|
|
|
|
|
|
bool tryGet(const std::string_view & name, Field & out_value) const;
|
|
|
|
const Field * tryGet(const std::string_view & name) const;
|
|
|
|
Field * tryGet(const std::string_view & name);
|
|
|
|
};
|
2019-04-18 23:29:32 +00:00
|
|
|
|
|
|
|
}
|