Go to the source code of this file.
Data Structures | |
class | hash_map< KeyId, Value, Traits > |
struct | hash_map< KeyId, Value, Traits >::hash_entry |
class | hash_map< KeyId, Value, Traits >::iterator |
class | hash_map< KeyId, Value, Traits >::iterator::reference_pair |
Macros | |
#define | DEFINE_PCH_HELPER(T) |
Enumerations | |
enum | hm_alloc { hm_heap = false , hm_ggc = true } |
Functions | |
template<typename K, typename V, typename H> | |
void | gt_ggc_mx (hash_map< K, V, H > *h) |
template<typename K, typename V, typename H> | |
void | gt_pch_nx (hash_map< K, V, H > *h) |
template<typename K, typename V, typename H> | |
void | gt_cleare_cache (hash_map< K, V, H > *h) |
template<typename K, typename V, typename H> | |
void | gt_pch_nx (hash_map< K, V, H > *h, gt_pointer_operator op, void *cookie) |
template<bool ggc, typename K, typename V, typename H> | |
hash_map< K, V, H > * | hash_map_maybe_create (hash_map< K, V, H > *&h, size_t size=default_hash_map_size) |
template<typename K, typename V, typename H> | |
V * | hash_map_safe_get (hash_map< K, V, H > *h, const K &k) |
template<bool ggc, typename K, typename V, typename H> | |
V & | hash_map_safe_get_or_insert (hash_map< K, V, H > *&h, const K &k, bool *e=NULL, size_t size=default_hash_map_size) |
template<bool ggc, typename K, typename V, typename H> | |
bool | hash_map_safe_put (hash_map< K, V, H > *&h, const K &k, const V &v, size_t size=default_hash_map_size) |
Variables | |
const size_t | default_hash_map_size = 13 |
#define DEFINE_PCH_HELPER | ( | T | ) |
enum hm_alloc |
|
inline |
References gt_cleare_cache(), and hash_map< KeyId, Value, Traits >::m_table.
Referenced by gt_cleare_cache().
|
inline |
ggc marking routines.
References gt_ggc_mx(), and hash_map< KeyId, Value, Traits >::m_table.
Referenced by gt_ggc_mx().
|
inline |
References gt_pch_nx(), and hash_map< KeyId, Value, Traits >::m_table.
Referenced by gt_pch_nx().
|
inline |
References hash_map< KeyId, Value, Traits >::m_table, and NULL.
|
inline |
References hash_map< KeyId, Value, Traits >::create_ggc(), and default_hash_map_size.
Referenced by hash_map_safe_get_or_insert(), and hash_map_safe_put().
|
inline |
Like h->get, but handles null h.
References hash_map< KeyId, Value, Traits >::get(), and NULL.
|
inline |
Like h->get, but handles null h.
References default_hash_map_size, hash_map_maybe_create(), and NULL.
|
inline |
Like h->put, but handles null h.
References default_hash_map_size, and hash_map_maybe_create().
const size_t default_hash_map_size = 13 |
A type-safe hash map. Copyright (C) 2014-2025 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Class hash_map is a hash-value based container mapping objects of KeyId type to those of the Value type. Both KeyId and Value may be non-trivial (non-POD) types provided a suitabe Traits class. A few default Traits specializations are provided for basic types such as integers, pointers, and std::pair. Inserted elements are value-initialized either to zero for POD types or by invoking their default ctor. Removed elements are destroyed by invoking their dtor. On hash_map destruction all elements are removed. Objects of hash_map type are copy-constructible but not assignable.
Referenced by hash_map< rdwr_access_hash, attr_access >::create_ggc(), hash_map< rdwr_access_hash, attr_access >::hash_map(), hash_map_maybe_create(), hash_map_safe_get_or_insert(), and hash_map_safe_put().