kzc_hash_set.hpp File Reference

Hash set. More...

Classes

struct  KzcHashSetIterator
 Accessor to the contents of a KzcHashSet. More...
 

Macros

#define kzcHashSetIterationBreak(hashSet)
 Break from a hash set iteration. More...
 
#define kzcHashSetIterate(iterator_param)
 Finds the next entry in the iterated hash set. More...
 
#define kzcHashSetIteratorStringGetValue(iterator_param)
 Returns the string value of the string hash map entry pointed by the iterator. More...
 

Functions

kzsError kzcHashSetCreateWithCapacity (const struct KzcMemoryManager *memoryManager, struct KzcHashMapConfiguration configuration, kzUint capacity, struct KzcHashSet **out_hashSet)
 Creates a new initially empty hash set. More...
 
kzsError kzcHashSetCreate (const struct KzcMemoryManager *memoryManager, struct KzcHashMapConfiguration configuration, struct KzcHashSet **out_hashSet)
 Creates a new initially empty hash set. More...
 
kzsError kzcHashSetCreateOrderedWithCapacity (const struct KzcMemoryManager *memoryManager, struct KzcHashMapConfiguration configuration, kzUint capacity, struct KzcHashSet **out_hashSet)
 Creates a new initially empty hash set, which ensures that the iteration order is same as the order of adding elements. More...
 
kzsError kzcHashSetCreateOrdered (const struct KzcMemoryManager *memoryManager, struct KzcHashMapConfiguration configuration, struct KzcHashSet **out_hashSet)
 Creates a new initially empty hash set, which ensures that the iteration order is same as the order of adding elements. More...
 
kzsError kzcHashSetDelete (struct KzcHashSet *hashSet)
 Frees the memory allocated for the hash set. More...
 
kzsError kzcHashSetClear (const struct KzcHashSet *hashSet)
 Clears the content of the hash set. More...
 
struct KzcHashMapConfiguration kzcHashSetGetConfiguration (const struct KzcHashSet *hashSet)
 Gets configuration. More...
 
kzUint kzcHashSetGetSize (const struct KzcHashSet *hashSet)
 Returns the number of entries stored in the hash set. More...
 
kzBool kzcHashSetIsEmpty (const struct KzcHashSet *hashSet)
 Checks if the hash set is empty or not. More...
 
struct KzcHashSetIterator kzcHashSetGetIterator (const struct KzcHashSet *hashSet)
 Returns an iterator to the hash set. More...
 
kzBool kzcHashSetIsValid (const struct KzcHashSet *hashSet)
 Ensures the specified hash set is valid. More...
 

Detailed Description

Hash set.

Hash set stores unique values, whose existence in the set can be queried in constant time.

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

#define kzcHashSetIterationBreak (   hashSet)

Break from a hash set iteration.

#define kzcHashSetIterate (   iterator_param)

Finds the next entry in the iterated hash set.

Parameters
iterator_paramKzcHashSetIterator structure.
Returns
KZ_TRUE if the next entry is found, otherwise KZ_FALSE.
#define kzcHashSetIteratorStringGetValue (   iterator_param)

Returns the string value of the string hash map entry pointed by the iterator.

Function Documentation

kzsError kzcHashSetCreateWithCapacity ( const struct KzcMemoryManager memoryManager,
struct KzcHashMapConfiguration  configuration,
kzUint  capacity,
struct KzcHashSet **  out_hashSet 
)

Creates a new initially empty hash set.

Initial capacity is given as a parameter.

kzsError kzcHashSetCreate ( const struct KzcMemoryManager memoryManager,
struct KzcHashMapConfiguration  configuration,
struct KzcHashSet **  out_hashSet 
)

Creates a new initially empty hash set.

kzsError kzcHashSetCreateOrderedWithCapacity ( const struct KzcMemoryManager memoryManager,
struct KzcHashMapConfiguration  configuration,
kzUint  capacity,
struct KzcHashSet **  out_hashSet 
)

Creates a new initially empty hash set, which ensures that the iteration order is same as the order of adding elements.

Initial capacity is given as a parameter.

kzsError kzcHashSetCreateOrdered ( const struct KzcMemoryManager memoryManager,
struct KzcHashMapConfiguration  configuration,
struct KzcHashSet **  out_hashSet 
)

Creates a new initially empty hash set, which ensures that the iteration order is same as the order of adding elements.

kzsError kzcHashSetDelete ( struct KzcHashSet hashSet)

Frees the memory allocated for the hash set.

kzsError kzcHashSetClear ( const struct KzcHashSet hashSet)

Clears the content of the hash set.

struct KzcHashMapConfiguration kzcHashSetGetConfiguration ( const struct KzcHashSet hashSet)

Gets configuration.

kzUint kzcHashSetGetSize ( const struct KzcHashSet hashSet)

Returns the number of entries stored in the hash set.

kzBool kzcHashSetIsEmpty ( const struct KzcHashSet hashSet)

Checks if the hash set is empty or not.

struct KzcHashSetIterator kzcHashSetGetIterator ( const struct KzcHashSet hashSet)

Returns an iterator to the hash set.

Call kzcHashSetIterate() before accessing the first and any subsequent entries.

kzBool kzcHashSetIsValid ( const struct KzcHashSet hashSet)

Ensures the specified hash set is valid.