summaryrefslogtreecommitdiffhomepage
path: root/docs/cset_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-21 20:49:22 +0200
committerTyge Løvset <[email protected]>2021-09-21 20:49:22 +0200
commitfbfb57d46e4d042c2c5ae1c5a56dad00660d3e3b (patch)
tree31dea2b7af4298d211b99e50b903be5f39ddebfb /docs/cset_api.md
parent32a3454eb463f86d7ace7b29c2e1574530499afc (diff)
downloadSTC-modified-fbfb57d46e4d042c2c5ae1c5a56dad00660d3e3b.tar.gz
STC-modified-fbfb57d46e4d042c2c5ae1c5a56dad00660d3e3b.zip
Added copy(self, other) function to all containers. Fixed some docs.
Diffstat (limited to 'docs/cset_api.md')
-rw-r--r--docs/cset_api.md19
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/cset_api.md b/docs/cset_api.md
index 99d7187e..22e65a5e 100644
--- a/docs/cset_api.md
+++ b/docs/cset_api.md
@@ -1,7 +1,7 @@
# STC [cset](../include/stc/cset.h): Unordered Set
![Set](pics/set.jpg)
-A **cset** is an associative container that contains a set of unique objects of type Key. Search, insertion, and removal have average constant-time complexity. See the c++ class
+A **cset** is an associative container that contains a set of unique objects of type i_key. Search, insertion, and removal have average constant-time complexity. See the c++ class
[std::unordered_set](https://en.cppreference.com/w/cpp/container/unordered_set) for a functional description.
## Header file and declaration
@@ -18,7 +18,7 @@ A **cset** is an associative container that contains a set of unique objects of
#define i_keydel // destroy key func - defaults to empty destruct
#include <stc/cset.h>
```
-`X` should be replaced by the value of ***i_tag*** in all of the following documentation.
+`X` should be replaced by the value of `i_tag` in all of the following documentation.
## Methods
@@ -28,6 +28,7 @@ cset_X cset_X_with_capacity(size_t cap);
cset_X cset_X_clone(cset_x set);
void cset_X_clear(cset_X* self);
+void cset_X_copy(cset_X* self, cset_X other);
void cset_X_max_load_factor(cset_X* self, float max_load); // default: 0.85
void cset_X_reserve(cset_X* self, size_t size);
void cset_X_shrink_to_fit(cset_X* self);
@@ -39,15 +40,15 @@ size_t cset_X_size(cset_X set);
size_t cset_X_capacity(cset_X set); // buckets * max_load_factor
size_t cset_X_bucket_count(cset_X set);
-bool cset_X_contains(const cset_X* self, RawKey rkey);
-cset_X_value_t* cset_X_get(const cset_X* self, RawKey rkey); // return NULL if not found
-cset_X_iter_t cset_X_find(const cset_X* self, RawKey rkey);
+bool cset_X_contains(const cset_X* self, i_keyraw rkey);
+cset_X_value_t* cset_X_get(const cset_X* self, i_keyraw rkey); // return NULL if not found
+cset_X_iter_t cset_X_find(const cset_X* self, i_keyraw rkey);
-cset_X_result_t cset_X_insert(cset_X* self, Key key);
-cset_X_result_t cset_X_emplace(cset_X* self, RawKey rkey);
-void cset_X_emplace_items(cset_X* self, const RawKey arr[], size_t n);
+cset_X_result_t cset_X_insert(cset_X* self, i_key key);
+cset_X_result_t cset_X_emplace(cset_X* self, i_keyraw rkey);
+void cset_X_emplace_items(cset_X* self, const i_keyraw arr[], size_t n);
-size_t cset_X_erase(cset_X* self, RawKey rkey); // return 0 or 1
+size_t cset_X_erase(cset_X* self, i_keyraw rkey); // return 0 or 1
cset_X_iter_t cset_X_erase_at(cset_X* self, cset_X_iter_t it); // return iter after it
void cset_X_erase_entry(cset_X* self, cset_X_value_t* entry);