31 #ifndef _CPL_HASH_SET_H_INCLUDED 32 #define _CPL_HASH_SET_H_INCLUDED 51 typedef struct _CPLHashSet CPLHashSet;
53 typedef unsigned long (*CPLHashSetHashFunc)(
const void* elt);
55 typedef int (*CPLHashSetEqualFunc)(
const void* elt1,
const void* elt2);
57 typedef void (*CPLHashSetFreeEltFunc)(
void* elt);
59 typedef int (*CPLHashSetIterEltFunc)(
void* elt,
void* user_data);
63 CPLHashSet CPL_DLL *
CPLHashSetNew(CPLHashSetHashFunc fnHashFunc,
64 CPLHashSetEqualFunc fnEqualFunc,
65 CPLHashSetFreeEltFunc fnFreeEltFunc);
72 CPLHashSetIterEltFunc fnIterFunc,
int CPLHashSetRemove(CPLHashSet *set, const void *elt)
Removes an element from a hash set.
Definition: cpl_hash_set.cpp:328
int CPLHashSetEqualPointer(const void *elt1, const void *elt2)
Equality function for arbitrary pointers.
Definition: cpl_hash_set.cpp:398
Core portability definitions for CPL.
int CPLHashSetEqualStr(const void *pszStr1, const void *pszStr2)
Equality function for strings.
Definition: cpl_hash_set.cpp:443
unsigned long CPLHashSetHashPointer(const void *elt)
Hash function for an arbitrary pointer.
Definition: cpl_hash_set.cpp:380
void CPLHashSetDestroy(CPLHashSet *set)
Destroys an allocated hash set.
Definition: cpl_hash_set.cpp:132
void * CPLHashSetLookup(CPLHashSet *set, const void *elt)
Returns the element found in the hash set corresponding to the element to look up The element must no...
Definition: cpl_hash_set.cpp:305
void CPLHashSetForeach(CPLHashSet *set, CPLHashSetIterEltFunc fnIterFunc, void *user_data)
Walk through the hash set and runs the provided function on all the elements.
Definition: cpl_hash_set.cpp:173
CPLHashSet * CPLHashSetNew(CPLHashSetHashFunc fnHashFunc, CPLHashSetEqualFunc fnEqualFunc, CPLHashSetFreeEltFunc fnFreeEltFunc)
Creates a new hash set.
Definition: cpl_hash_set.cpp:80
int CPLHashSetSize(const CPLHashSet *set)
Returns the number of elements inserted in the hash set.
Definition: cpl_hash_set.cpp:113
unsigned long CPLHashSetHashStr(const void *pszStr)
Hash function for a zero-terminated string.
Definition: cpl_hash_set.cpp:415
int CPLHashSetInsert(CPLHashSet *set, void *elt)
Inserts an element into a hash set.
Definition: cpl_hash_set.cpp:261