|
Blender
V2.59
|
A general (pointer -> pointer) hash table ADT. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "BLI_mempool.h"#include "BLI_blenlib.h"Go to the source code of this file.
Classes | |
| struct | Entry |
| struct | GHash |
| struct | GHashIterator |
Typedefs | |
| typedef unsigned int(* | GHashHashFP )(const void *key) |
| typedef int(* | GHashCmpFP )(const void *a, const void *b) |
| typedef void(* | GHashKeyFreeFP )(void *key) |
| typedef void(* | GHashValFreeFP )(void *val) |
| typedef struct Entry | Entry |
| typedef struct GHash | GHash |
| typedef struct GHashIterator | GHashIterator |
Functions | |
| GHash * | BLI_ghash_new (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) |
| void | BLI_ghash_free (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| int | BLI_ghash_size (GHash *gh) |
| GHashIterator * | BLI_ghashIterator_new (GHash *gh) |
| void | BLI_ghashIterator_init (GHashIterator *ghi, GHash *gh) |
| void | BLI_ghashIterator_free (GHashIterator *ghi) |
| void * | BLI_ghashIterator_getKey (GHashIterator *ghi) |
| void * | BLI_ghashIterator_getValue (GHashIterator *ghi) |
| void | BLI_ghashIterator_step (GHashIterator *ghi) |
| int | BLI_ghashIterator_isDone (GHashIterator *ghi) |
| unsigned int | BLI_ghashutil_ptrhash (const void *key) |
| int | BLI_ghashutil_ptrcmp (const void *a, const void *b) |
| unsigned int | BLI_ghashutil_strhash (const void *key) |
| int | BLI_ghashutil_strcmp (const void *a, const void *b) |
| unsigned int | BLI_ghashutil_inthash (const void *ptr) |
| int | BLI_ghashutil_intcmp (const void *a, const void *b) |
| BM_INLINE void | BLI_ghash_insert (GHash *gh, void *key, void *val) |
| BM_INLINE void * | BLI_ghash_lookup (GHash *gh, const void *key) |
| BM_INLINE int | BLI_ghash_remove (GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| BM_INLINE int | BLI_ghash_haskey (GHash *gh, void *key) |
Variables | |
| unsigned int | hashsizes [] |
A general (pointer -> pointer) hash table ADT.
Definition in file BLI_ghash.h.
| typedef int(* GHashCmpFP)(const void *a, const void *b) |
Definition at line 50 of file BLI_ghash.h.
| typedef unsigned int(* GHashHashFP)(const void *key) |
Definition at line 49 of file BLI_ghash.h.
| typedef struct GHashIterator GHashIterator |
| typedef void(* GHashKeyFreeFP)(void *key) |
Definition at line 51 of file BLI_ghash.h.
| typedef void(* GHashValFreeFP)(void *val) |
Definition at line 52 of file BLI_ghash.h.
| void BLI_ghash_free | ( | GHash * | gh, |
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp | ||
| ) |
Definition at line 78 of file BLI_ghash.c.
References BLI_mempool_destroy(), GHash::buckets, GHash::entrypool, i, MEM_freeN(), GHash::nbuckets, GHash::nentries, Entry::next, and NULL.
Referenced by animdata_filter_remove_duplis(), applyModifier(), BIF_freeTemplates(), BIF_makeListTemplates(), BKE_icons_free(), BKE_nlastrip_validate_name(), BLI_argsFree(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_free_transdata(), build_mesh_leaf_node(), cloneRigGraph(), cloth_bvh_objcollisions_nearcheck(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), createSlideVerts(), esubdivideflag(), free_editNurb_keyIndex(), free_forest(), free_mesh_orco_hash(), free_pose_channels_hash(), free_scratch(), free_sss(), free_undoCurve(), freeSlideVerts(), game_copy_pose(), GPU_extensions_exit(), imb_thread_cache_exit(), imb_tile_cache_exit(), knife_cut_exec(), mesh_get_x_mirror_faces(), REEB_freeArc(), RIG_freeRigGraph(), RNA_exit(), seq_stripelem_cache_cleanup(), seq_stripelem_cache_destruct(), strand_shade_cache_free(), undoCurve_to_editCurve(), WM_menutype_free(), wm_operatortype_free(), and wpaint_make_validmap().
| BM_INLINE int BLI_ghash_haskey | ( | GHash * | gh, |
| void * | key | ||
| ) |
Definition at line 260 of file BLI_ghash.h.
References GHash::buckets, GHash::cmpfp, hash, GHash::hashfp, Entry::key, GHash::nbuckets, and Entry::next.
Referenced by animdata_filter_remove_duplis(), applyModifier(), BLO_blendhandle_get_linkable_groups(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), esubdivideflag(), map_insert_vert(), nla_editbone_name_check(), RIG_reconnectControlBones(), and wpaint_make_validmap().
| BM_INLINE void BLI_ghash_insert | ( | GHash * | gh, |
| void * | key, | ||
| void * | val | ||
| ) |
Definition at line 184 of file BLI_ghash.h.
References BLI_mempool_alloc(), GHash::buckets, GHash::cursize, GHash::entrypool, hash, GHash::hashfp, i, Entry::key, MEM_freeN(), MEM_mallocN(), GHash::nbuckets, GHash::nentries, Entry::next, Entry::val, and simple_enum_gen::val.
Referenced by addFacetoArc(), animdata_filter_remove_duplis(), applyModifier(), BIF_makeListTemplates(), BKE_icon_getid(), BKE_icon_set(), BKE_nlastrip_validate_name(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_assign_transdata(), ccd_build_deflector_hash(), cloneArc(), cloneControl(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), ED_armature_bone_rename(), esubdivideflag(), game_copy_pose(), get_object_orco(), gpu_parse_functions_string(), imb_global_cache_get_tile(), imb_thread_cache_get_tile(), init_editNurb_keyIndex(), internalAdd(), keyIndex_swap(), keyIndex_updateCV(), knife_cut_exec(), make_pose_channels_hash(), map_insert_vert(), mergeArcFaces(), mesh_get_x_mirror_faces(), RIG_addControlBone(), RIG_arcFromBoneChain(), RNA_def_property(), RNA_init(), seq_stripelem_cache_put(), set_object_orco(), sss_create_tree_mat(), strand_shade_get(), strand_shade_refcount(), WM_menutype_add(), WM_operatortype_append(), WM_operatortype_append_macro(), WM_operatortype_append_macro_ptr(), WM_operatortype_append_ptr(), and wpaint_make_validmap().
| BM_INLINE void* BLI_ghash_lookup | ( | GHash * | gh, |
| const void * | key | ||
| ) |
Definition at line 217 of file BLI_ghash.h.
References GHash::buckets, GHash::cmpfp, hash, GHash::hashfp, Entry::key, GHash::nbuckets, Entry::next, NULL, and Entry::val.
Referenced by applyModifier(), BIF_setTemplate(), BKE_icon_changed(), BKE_icon_get(), BKE_icon_set(), BLI_pbvh_get_grid_updates(), BME_assign_transdata(), BME_get_transdata(), ccd_build_deflector_hash(), ccd_update_deflector_hash(), cloneArc(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), createSlideVerts(), dag_find_node(), doEdgeSlide(), fill_quad_double_adj_fan(), fill_quad_double_adj_inner(), fill_quad_double_adj_path(), fill_quad_double_op(), fill_quad_quadruple(), fill_quad_single(), fill_quad_singlevert(), fill_quad_triple(), fill_tri_double(), fill_tri_single(), fill_tri_triple(), freeSlideVerts(), game_copy_pose(), get_next_free_id(), get_object_orco(), get_pose_channel(), getCVKeyIndex(), GPU_build_mesh_buffers(), GPU_lookup_function(), imb_global_cache_get_tile(), imb_thread_cache_get_tile(), imb_tile_cache_tile_free(), lookUp(), map_insert_vert(), mesh_get_x_mirror_faces(), RIG_reconnectControlBones(), sample_sss(), seg_intersect(), seq_stripelem_cache_get(), sss_pass_done(), strand_shade_get(), strand_shade_refcount(), strand_shade_unref(), WM_menutype_find(), WM_operatortype_find(), and wpaint_make_validmap().
| GHash* BLI_ghash_new | ( | GHashHashFP | hashfp, |
| GHashCmpFP | cmpfp, | ||
| const char * | info | ||
| ) |
Definition at line 54 of file BLI_ghash.c.
References BLI_mempool_create(), GHash::buckets, GHash::cmpfp, GHash::cursize, GHash::entrypool, GHash::hashfp, hashsizes, MEM_mallocN(), GHash::nbuckets, and GHash::nentries.
Referenced by animdata_filter_remove_duplis(), applyModifier(), BIF_makeListTemplates(), BKE_icons_init(), BKE_nlastrip_validate_name(), BLI_argsInit(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_init_transdata(), build_mesh_leaf_node(), cloneRigGraph(), cloth_bvh_objcollisions_nearcheck(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), copyArc(), createArc(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), esubdivideflag(), game_copy_pose(), get_object_orco(), GPU_lookup_function(), imb_thread_cache_init(), IMB_tile_cache_params(), init_editNurb_keyIndex(), knife_cut_exec(), make_pose_channels_hash(), make_sss_tree(), mesh_get_x_mirror_faces(), newRigGraph(), RNA_init(), sb_new_scratch(), seq_stripelem_cache_cleanup(), seq_stripelem_cache_init(), set_object_orco(), strand_shade_cache_create(), WM_menutype_init(), wm_operatortype_init(), and wpaint_make_validmap().
| BM_INLINE int BLI_ghash_remove | ( | GHash * | gh, |
| void * | key, | ||
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp | ||
| ) |
Definition at line 230 of file BLI_ghash.h.
References BLI_mempool_free(), GHash::buckets, GHash::cmpfp, GHash::entrypool, hash, GHash::hashfp, Entry::key, GHash::nbuckets, GHash::nentries, Entry::next, NULL, p, and Entry::val.
Referenced by BKE_icon_delete(), createSlideVerts(), ED_armature_bone_rename(), imb_global_cache_get_tile(), imb_thread_cache_get_tile(), imb_tile_cache_tile_free(), keyIndex_delCV(), keyIndex_delNurb(), keyIndex_swap(), keyIndex_updateCV(), seq_stripelem_cache_put(), strand_shade_get(), strand_shade_unref(), WM_menutype_freelink(), WM_operatortype_remove(), and wpaint_make_validmap().
| int BLI_ghash_size | ( | GHash * | gh | ) |
Definition at line 74 of file BLI_ghash.c.
References GHash::nentries.
Referenced by applyModifier(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), filterSmartReebGraph(), REEB_exportGraph(), and verifyFaces().
| void BLI_ghashIterator_free | ( | GHashIterator * | ghi | ) |
Free a GHashIterator.
| ghi | The iterator to free. |
Definition at line 130 of file BLI_ghash.c.
References MEM_freeN().
Referenced by applyModifier(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), free_sss(), operator_search_cb(), pyop_dir(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), WM_menutype_contains(), and WM_menutype_free().
| void* BLI_ghashIterator_getKey | ( | GHashIterator * | ghi | ) |
Retrieve the key from an iterator.
| ghi | The iterator. |
Definition at line 134 of file BLI_ghash.c.
References GHashIterator::curEntry, Entry::key, and NULL.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), and sb_detect_vertex_collisionCached().
| void* BLI_ghashIterator_getValue | ( | GHashIterator * | ghi | ) |
Retrieve the value from an iterator.
| ghi | The iterator. |
Definition at line 137 of file BLI_ghash.c.
References GHashIterator::curEntry, NULL, and Entry::val.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), build_mesh_leaf_node(), dupli_keyIndexHash(), filterSmartReebGraph(), free_sss(), mergeArcFaces(), operator_search_cb(), pyop_dir(), RIG_reconnectControlBones(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), WM_menutype_contains(), and WM_menutype_free().
| void BLI_ghashIterator_init | ( | GHashIterator * | ghi, |
| GHash * | gh | ||
| ) |
Init an already allocated GHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly BLI_ghash_size(gh) times before becoming done.
| ghi | The GHashIterator to initialize. |
| gh | The GHash to iterate over. |
Definition at line 119 of file BLI_ghash.c.
References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, GHash::nbuckets, and NULL.
Referenced by BIF_currentTemplate(), BIF_listTemplates(), filterSmartReebGraph(), mergeArcFaces(), and RIG_reconnectControlBones().
| int BLI_ghashIterator_isDone | ( | GHashIterator * | ghi | ) |
Determine if an iterator is done (has reached the end of the hash table).
| ghi | The iterator. |
Definition at line 152 of file BLI_ghash.c.
References GHashIterator::curEntry.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), filterSmartReebGraph(), free_sss(), mergeArcFaces(), operator_search_cb(), pyop_dir(), RIG_reconnectControlBones(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), WM_menutype_contains(), and WM_menutype_free().
| GHashIterator* BLI_ghashIterator_new | ( | GHash * | gh | ) |
Create a new GHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly BLI_ghash_size(gh) times before becoming done.
| gh | The GHash to iterate over. |
Definition at line 106 of file BLI_ghash.c.
References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, MEM_mallocN(), GHash::nbuckets, and NULL.
Referenced by applyModifier(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), free_sss(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), WM_menutype_contains(), WM_menutype_free(), and WM_operatortype_iter().
| void BLI_ghashIterator_step | ( | GHashIterator * | ghi | ) |
Steps the iterator to the next index.
| ghi | The iterator. |
Definition at line 141 of file BLI_ghash.c.
References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, GHash::nbuckets, and Entry::next.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), filterSmartReebGraph(), free_sss(), mergeArcFaces(), operator_search_cb(), pyop_dir(), RIG_reconnectControlBones(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), WM_menutype_contains(), and WM_menutype_free().
| int BLI_ghashutil_intcmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 181 of file BLI_ghash.c.
Referenced by applyModifier(), BIF_makeListTemplates(), BKE_icons_init(), build_mesh_leaf_node(), and keycmp().
| unsigned int BLI_ghashutil_inthash | ( | const void * | ptr | ) |
Definition at line 168 of file BLI_ghash.c.
Referenced by applyModifier(), BIF_makeListTemplates(), BKE_icons_init(), and build_mesh_leaf_node().
| int BLI_ghashutil_ptrcmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 161 of file BLI_ghash.c.
Referenced by animdata_filter_remove_duplis(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_init_transdata(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), copyArc(), createArc(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), esubdivideflag(), game_copy_pose(), get_object_orco(), init_editNurb_keyIndex(), knife_cut_exec(), make_sss_tree(), sb_new_scratch(), set_object_orco(), and strand_shade_cache_create().
| unsigned int BLI_ghashutil_ptrhash | ( | const void * | key | ) |
Definition at line 158 of file BLI_ghash.c.
Referenced by animdata_filter_remove_duplis(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_init_transdata(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), copyArc(), createArc(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), esubdivideflag(), game_copy_pose(), get_object_orco(), init_editNurb_keyIndex(), knife_cut_exec(), make_sss_tree(), sb_new_scratch(), set_object_orco(), and strand_shade_cache_create().
| int BLI_ghashutil_strcmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 198 of file BLI_ghash.c.
Referenced by applyModifier(), BKE_nlastrip_validate_name(), GPU_lookup_function(), make_pose_channels_hash(), newRigGraph(), RNA_init(), WM_menutype_init(), wm_operatortype_init(), and wpaint_make_validmap().
| unsigned int BLI_ghashutil_strhash | ( | const void * | key | ) |
Definition at line 188 of file BLI_ghash.c.
References i.
Referenced by applyModifier(), BKE_nlastrip_validate_name(), GPU_lookup_function(), make_pose_channels_hash(), newRigGraph(), RNA_init(), ui_popup_menu_hash(), ui_popup_string_hash(), WM_menutype_init(), wm_operatortype_init(), and wpaint_make_validmap().
| unsigned int hashsizes[] |
Definition at line 43 of file BLI_ghash.c.
Referenced by BLI_edgehash_insert(), BLI_edgehash_new(), and BLI_ghash_new().