libUnihan
0.5.3
|
HashSet: A set which backed by Hash Table. More...
#include <collection.h>
Data Fields | |
GHashTable * | hTable |
The backing GHashTable. | |
ElementType | setType |
Element type of key. | |
HashSet provides a hash table (GHashTable) backed data structure for set-like data. Unlike GHashTable which works on key-value pairs; HashSet, however, deals with only element values, as they serve as both keys and values. In other words, each element value is inserted to GHashTable as keys and values.
The property setType
not only tells what this HashSet stores, but also determine the default handler functions such as element hash and equal functions.
Note that due to the nature or hash table, the element order is deemed to be unstable. Also, since GHashTable does not copy key and value, neither does HashSet. The referred storages should remain present until HashSet is freed.