Hash set. More...
#include <kanzi/core/legacy/util/collection/kzc_hash_code.hpp>
#include <kanzi/core/legacy/util/collection/kzc_comparator.hpp>
#include <kanzi/core/legacy/util/collection/kzc_hash_map.hpp>
#include <kanzi/core/legacy/kzs_types.hpp>
#include <kanzi/core/legacy/debug/kzs_error.hpp>
#include "kzc_hash_set_accessors_hpp.inl"
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 | |
KANZI_API kzsError | kzcHashSetCreateWithCapacity (const struct KzcMemoryManager *memoryManager, struct KzcHashMapConfiguration configuration, kzUint capacity, struct KzcHashSet **out_hashSet) |
Creates a new initially empty hash set. More... | |
KANZI_API kzsError | kzcHashSetCreate (const struct KzcMemoryManager *memoryManager, struct KzcHashMapConfiguration configuration, struct KzcHashSet **out_hashSet) |
Creates a new initially empty hash set. More... | |
KANZI_API 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... | |
KANZI_API 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... | |
KANZI_API kzsError | kzcHashSetDelete (struct KzcHashSet *hashSet) |
Frees the memory allocated for the hash set. More... | |
KANZI_API kzsError | kzcHashSetClear (const struct KzcHashSet *hashSet) |
Clears the content of the hash set. More... | |
KANZI_API struct KzcHashMapConfiguration | kzcHashSetGetConfiguration (const struct KzcHashSet *hashSet) |
Gets configuration. More... | |
KANZI_API kzUint | kzcHashSetGetSize (const struct KzcHashSet *hashSet) |
Returns the number of entries stored in the hash set. More... | |
KANZI_API kzBool | kzcHashSetIsEmpty (const struct KzcHashSet *hashSet) |
Checks if the hash set is empty or not. More... | |
KANZI_API struct KzcHashSetIterator | kzcHashSetGetIterator (const struct KzcHashSet *hashSet) |
Returns an iterator to the hash set. More... | |
KANZI_API kzBool | kzcHashSetIsValid (const struct KzcHashSet *hashSet) |
Ensures the specified hash set is valid. More... | |
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.
#define kzcHashSetIterationBreak | ( | hashSet | ) |
Break from a hash set iteration.
#define kzcHashSetIterate | ( | iterator_param | ) |
Finds the next entry in the iterated hash set.
iterator_param | KzcHashSetIterator structure. |
#define kzcHashSetIteratorStringGetValue | ( | iterator_param | ) |
Returns the string value of the string hash map entry pointed by the iterator.
KANZI_API 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.
KANZI_API kzsError kzcHashSetCreate | ( | const struct KzcMemoryManager * | memoryManager, |
struct KzcHashMapConfiguration | configuration, | ||
struct KzcHashSet ** | out_hashSet | ||
) |
Creates a new initially empty hash set.
KANZI_API 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.
KANZI_API 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.
KANZI_API kzsError kzcHashSetDelete | ( | struct KzcHashSet * | hashSet | ) |
Frees the memory allocated for the hash set.
KANZI_API kzsError kzcHashSetClear | ( | const struct KzcHashSet * | hashSet | ) |
Clears the content of the hash set.
KANZI_API struct KzcHashMapConfiguration kzcHashSetGetConfiguration | ( | const struct KzcHashSet * | hashSet | ) |
Gets configuration.
KANZI_API kzUint kzcHashSetGetSize | ( | const struct KzcHashSet * | hashSet | ) |
Returns the number of entries stored in the hash set.
KANZI_API kzBool kzcHashSetIsEmpty | ( | const struct KzcHashSet * | hashSet | ) |
Checks if the hash set is empty or not.
KANZI_API struct KzcHashSetIterator kzcHashSetGetIterator | ( | const struct KzcHashSet * | hashSet | ) |
Returns an iterator to the hash set.
Call kzcHashSetIterate() before accessing the first and any subsequent entries.
KANZI_API kzBool kzcHashSetIsValid | ( | const struct KzcHashSet * | hashSet | ) |
Ensures the specified hash set is valid.