64 using Key = std::string;
65 using Pair = std::pair<Key, Value>;
67 using ValueView = std::variant<
78 impl::JsonStringViewForInitializerList>;
80 using InitializerList = std::initializer_list<std::pair<std::string_view, ValueView>>;
141 template <typename Iterator>
144 for (Iterator it = first; it != last; ++it) {
152 friend class LogHelper;
153 friend class impl::LogExtraTskvFormatter;
154 friend class impl::TagWriter;
159 const Value& GetValue(std::string_view key)
const;
161 class ProtectedValue final {
163 ProtectedValue() =
default;
164 ProtectedValue(
Value value,
bool frozen);
165 ProtectedValue(
const ProtectedValue& other) =
default;
166 ProtectedValue(ProtectedValue&& other) =
default;
168 ProtectedValue& operator=(
const ProtectedValue& other);
169 ProtectedValue& operator=(ProtectedValue&& other)
noexcept;
171 bool IsFrozen() const noexcept;
173 Value& GetValue() noexcept {
return value_; }
174 const Value& GetValue() const noexcept {
return value_; }
175 void AssignIgnoringFrozenness(ProtectedValue other);
179 bool frozen_ =
false;
182 static constexpr std::size_t kSmallVectorSize = 24;
183 static constexpr std::size_t kPimplSize =
184 compiler::SelectSize().ForLibCpp32(1168).ForLibCpp64(1560).ForLibStdCpp64(1944).ForLibStdCpp32(1356);
185 using MapItem = std::pair<Key, ProtectedValue>;
186 using Map = boost::container::small_vector<MapItem, kSmallVectorSize>;
192 std::pair<Key, ProtectedValue>* Find(std::string_view);
194 const std::pair<Key, ProtectedValue>* Find(std::string_view)
const;
196 utils::FastPimpl<Map, kPimplSize,
alignof(
void*)> extra_;