Lines Matching refs:Key
24 template <typename Key, typename ScopedPtr>
26 typedef base::hash_map<Key, typename ScopedPtr::element_type*> Container;
39 void swap(ScopedPtrHashMap<Key, ScopedPtr>& other) {
43 // Replaces value but not key if key is already present.
44 iterator set(const Key& key, ScopedPtr data) {
45 iterator it = find(key);
54 return data_.insert(std::make_pair(key, data.release())).first;
57 // Does nothing if key is already present
58 std::pair<iterator, bool> add(const Key& key, ScopedPtr data) {
60 data_.insert(std::make_pair(key, data.get()));
72 size_t erase(const Key& k) {
90 ScopedPtr take(const Key& k) {
108 ScopedPtr take_and_erase(const Key& k) {
116 // Returns the element in the hash_map that matches the given key.
118 typename ScopedPtr::element_type* get(const Key& k) const {
125 inline bool contains(const Key& k) const { return data_.count(k) > 0; }
132 // do so if the key is a pointer into the value object.
141 inline const_iterator find(const Key& k) const { return data_.find(k); }
142 inline iterator find(const Key& k) { return data_.find(k); }
144 inline size_t count(const Key& k) const { return data_.count(k); }
146 const Key& k) const {
149 inline std::pair<iterator, iterator> equal_range(const Key& k) {