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) {
143 Extend(*it, extend_type);
151 friend class LogHelper;
152 friend class impl::LogExtraTskvFormatter;
153 friend class impl::TagWriter;
158 const Value& GetValue(std::string_view key)
const;
160 class ProtectedValue
final {
162 ProtectedValue() =
default;
163 ProtectedValue(Value value,
bool frozen);
164 ProtectedValue(
const ProtectedValue& other) =
default;
165 ProtectedValue(ProtectedValue&& other) =
default;
167 ProtectedValue& operator=(
const ProtectedValue& other);
168 ProtectedValue& operator=(ProtectedValue&& other)
noexcept;
170 bool IsFrozen()
const;
172 Value& GetValue() {
return value_; }
173 const Value& GetValue()
const {
return value_; }
174 void AssignIgnoringFrozenness(ProtectedValue other);
178 bool frozen_ =
false;
181 static constexpr std::size_t kSmallVectorSize = 24;
182 static constexpr std::size_t kPimplSize =
183 compiler::SelectSize().ForLibCpp32(1168).ForLibCpp64(1560).ForLibStdCpp64(1944).ForLibStdCpp32(1356);
184 using MapItem = std::pair<Key, ProtectedValue>;
185 using Map = boost::container::small_vector<MapItem, kSmallVectorSize>;
191 std::pair<Key, ProtectedValue>* Find(std::string_view);
193 const std::pair<Key, ProtectedValue>* Find(std::string_view)
const;
195 utils::FastPimpl<Map, kPimplSize,
alignof(
void*)> extra_;