Lines Matching refs:key
221 const TValue* Get(const TKey<TValue>& key) const { in Get()
222 return GetValuePtr(key); in Get()
228 TValue* Get(const TKey<TValue>& key) { in Get()
229 return GetValuePtr(key); in Get()
235 std::optional<TValue> GetOptional(const TKey<TValue>& key) const { in GetOptional()
236 auto* ptr = Get(key); in GetOptional()
243 TValue GetOrDefault(const TKey<TValue>& key) const { in GetOrDefault()
244 auto* ptr = Get(key); in GetOrDefault()
245 return (ptr == nullptr) ? key.CreateDefaultValue() : *ptr; in GetOrDefault()
249 void AssignIfExists(const TKey<T>& key, U* out) { in AssignIfExists()
251 if (Exists(key)) { in AssignIfExists()
252 *out = std::move(*Get(key)); in AssignIfExists()
260 ScopedRemove(VariantMap& map, const TKey<TValue>& key) : map_(map), key_(key) {} in ScopedRemove()
273 TValue ReleaseOrDefault(const TKey<TValue>& key) { in ReleaseOrDefault()
274 ScopedRemove<TValue> remove_on_return(*this, key); in ReleaseOrDefault()
276 TValue* ptr = Get(key); in ReleaseOrDefault()
280 return key.CreateDefaultValue(); in ReleaseOrDefault()
286 bool Exists(const TKey<TValue>& key) const { in Exists()
287 return GetKeyValueIterator(key) != storage_map_.end(); in Exists()
293 void Set(const TKey<TValue>& key, const typename Identity<TValue>::type& value) { in Set()
297 Remove(key); in Set()
298 bool inserted = storage_map_.insert({key.Clone(), new_value}).second; in Set()
306 bool SetIfMissing(const TKey<TValue>& key, const typename Identity<TValue>::type& value) { in SetIfMissing()
307 TValue* ptr = Get(key); in SetIfMissing()
309 Set(key, value); in SetIfMissing()
317 void Remove(const TKey<TValue>& key) { in Remove()
320 auto&& it = GetKeyValueIterator(key); in Remove()
322 key.ValueDelete(it->second); in Remove()
397 void InitializeParameters(const TK& key, const TValue& value, const Rest& ... rest) { in InitializeParameters()
400 const TKey<TValue>& key_refined = key; in InitializeParameters()
422 typename StorageMap::iterator GetKeyValueIterator(const TKey<TValue>& key) { in GetKeyValueIterator()
425 const TKey<TValue>* key_ptr = &key; in GetKeyValueIterator()
431 typename StorageMap::const_iterator GetKeyValueIterator(const TKey<TValue>& key) const { in GetKeyValueIterator()
434 const TKey<TValue>* key_ptr = &key; in GetKeyValueIterator()
440 TValue* GetValuePtr(const TKey<TValue>& key) { in GetValuePtr()
441 return const_cast<TValue*>(GetValueConstPtr(key)); in GetValuePtr()
445 const TValue* GetValuePtr(const TKey<TValue>& key) const { in GetValuePtr()
446 return GetValueConstPtr(key); in GetValuePtr()
450 const TValue* GetValueConstPtr(const TKey<TValue>& key) const { in GetValueConstPtr()
451 auto&& it = GetKeyValueIterator(key); in GetValueConstPtr()