50 using Value = std::variant<
62 using Key = std::string;
63 using Pair = std::pair<Key, Value>;
65 using ValueView = std::variant<
76 impl::JsonStringViewForInitializerList>;
78 using InitializerList = std::initializer_list<std::pair<std::string_view, ValueView>>;
88 LogExtra(
const LogExtra&);
96 LogExtra& operator=(LogExtra&&);
98 LogExtra& operator=(
const LogExtra&);
139 template <
typename Iterator>
142 for (Iterator it = first; it != last; ++it) Extend(*it, extend_type);
149 friend class LogHelper;
150 friend class impl::LogExtraTskvFormatter;
151 friend class impl::TagWriter;
156 const Value& GetValue(std::string_view key)
const;
158 class ProtectedValue
final {
160 ProtectedValue() =
default;
161 ProtectedValue(Value value,
bool frozen);
162 ProtectedValue(
const ProtectedValue& other) =
default;
163 ProtectedValue(ProtectedValue&& other) =
default;
165 ProtectedValue& operator=(
const ProtectedValue& other);
166 ProtectedValue& operator=(ProtectedValue&& other)
noexcept;
168 bool IsFrozen()
const;
170 Value& GetValue() {
return value_; }
171 const Value& GetValue()
const {
return value_; }
172 void AssignIgnoringFrozenness(ProtectedValue other);
176 bool frozen_ =
false;
179 static constexpr std::size_t kSmallVectorSize = 24;
180 static constexpr std::size_t kPimplSize =
181 compiler::SelectSize().ForLibCpp32(1168).ForLibCpp64(1560).ForLibStdCpp64(1944).ForLibStdCpp32(1356);
182 using MapItem = std::pair<Key, ProtectedValue>;
183 using Map = boost::container::small_vector<MapItem, kSmallVectorSize>;
189 std::pair<Key, ProtectedValue>* Find(std::string_view);
191 const std::pair<Key, ProtectedValue>* Find(std::string_view)
const;
193 utils::FastPimpl<Map, kPimplSize,
alignof(
void*)> extra_;