summaryrefslogtreecommitdiff
path: root/archive/src/std/containers/hashset.h
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-05 12:48:05 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-05 12:48:05 +1000
commitdfb6adbcbcc7d50b770b6d5ea82efdd8f8c32e25 (patch)
treea470b91a90716d7ea46fde53ed395449c24583a2 /archive/src/std/containers/hashset.h
parent54354e32c6498cc7f8839ab4deb1208d37216cc5 (diff)
delete documentation workflow
Diffstat (limited to 'archive/src/std/containers/hashset.h')
-rw-r--r--archive/src/std/containers/hashset.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/archive/src/std/containers/hashset.h b/archive/src/std/containers/hashset.h
new file mode 100644
index 0000000..7f87213
--- /dev/null
+++ b/archive/src/std/containers/hashset.h
@@ -0,0 +1,29 @@
+/**
+ * @file hashset.h
+ * @author your name (you@domain.com)
+ * @brief
+ * @version 0.1
+ * @date 2024-04-27
+ *
+ * @copyright Copyright (c) 2024
+ *
+ */
+
+#include "defines.h"
+
+typedef struct hashset hashset;
+
+/** @brief Describes a function that will take a pointer to a datatype (e.g. a u64 or a struct)
+ and return a hashed key. */
+typedef uint64_t (*hash_item)(void* item);
+
+void hashset_init(hashset* set, hash_item hash_func, size_t initial_capacity);
+// TODO: void hashset_from_iterator();
+bool hashset_insert(hashset* set, void* item, uint64_t* out_key);
+void hashset_batch_insert(hashset* set, void* items, u64 item_count);
+bool hashset_contains(hashset* set, void* item);
+bool hashset_remove_item(hashset* set, void* item);
+bool hashset_remove_key(hashset* set, uint64_t key);
+void hashset_merge(hashset* set_a, hashset* set_b);
+hashset* hashset_merge_cloned(hashset* set_a, hashset* set_b);
+void hashset_free(hashset* set); \ No newline at end of file