40 using Value = std::variant<
52 using Key = std::string;
53 using Pair = std::pair<Key, Value>;
63 LogExtra(
const LogExtra&);
71 LogExtra& operator=(LogExtra&&);
73 LogExtra& operator=(
const LogExtra&);
114 template <
typename Iterator>
117 for (Iterator it = first; it != last; ++it) Extend(*it, extend_type);
124 friend class LogHelper;
125 friend class impl::LogExtraTskvFormatter;
126 friend class impl::TagWriter;
131 const Value& GetValue(std::string_view key)
const;
133 class ProtectedValue
final {
135 ProtectedValue() =
default;
136 ProtectedValue(Value value,
bool frozen);
137 ProtectedValue(
const ProtectedValue& other) =
default;
138 ProtectedValue(ProtectedValue&& other) =
default;
140 ProtectedValue& operator=(
const ProtectedValue& other);
141 ProtectedValue& operator=(ProtectedValue&& other)
noexcept;
143 bool IsFrozen()
const;
145 Value& GetValue() {
return value_; }
146 const Value& GetValue()
const {
return value_; }
147 void AssignIgnoringFrozenness(ProtectedValue other);
151 bool frozen_ =
false;
154 static constexpr std::size_t kSmallVectorSize = 24;
155 static constexpr std::size_t kPimplSize =
156 compiler::SelectSize().ForLibCpp32(1168).ForLibCpp64(1560).ForLibStdCpp64(1944).ForLibStdCpp32(1356);
157 using MapItem = std::pair<Key, ProtectedValue>;
158 using Map = boost::container::small_vector<MapItem, kSmallVectorSize>;
164 std::pair<Key, ProtectedValue>* Find(std::string_view);
166 const std::pair<Key, ProtectedValue>* Find(std::string_view)
const;
168 utils::FastPimpl<Map, kPimplSize,
alignof(
void*)> extra_;