00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUCON_USET_H
00019 #define CUCON_USET_H
00020
00021 #include <cucon/fwd.h>
00022 #include <cucon/umap.h>
00023
00024 CU_BEGIN_DECLARATIONS
00025
00026
00027
00028
00029
00030
00031
00032
00033 struct cucon_uset { struct cucon_umap impl; };
00034
00035
00036 CU_SINLINE void cucon_uset_init(cucon_uset_t set)
00037 { cucon_umap_init(&set->impl); }
00038
00039
00040 CU_SINLINE cucon_uset_t cucon_uset_new(void)
00041 { return (cucon_uset_t)cucon_umap_new(); }
00042
00043
00044 CU_SINLINE void cucon_uset_init_copy(cucon_uset_t set, cucon_uset_t src_set)
00045 { cucon_umap_init_copy_void(&set->impl, &src_set->impl); }
00046
00047
00048 CU_SINLINE cucon_uset_t cucon_uset_new_copy(cucon_uset_t src_set)
00049 { return (cucon_uset_t)cucon_umap_new_copy_void(&src_set->impl); }
00050
00051
00052 CU_SINLINE void cucon_uset_swap(cucon_uset_t set0, cucon_uset_t set1)
00053 { cucon_umap_swap(&set0->impl, &set1->impl); }
00054
00055
00056 CU_SINLINE cu_bool_t cucon_uset_eq(cucon_uset_t set0, cucon_uset_t set1)
00057 { return cucon_umap_eq_keys(&set0->impl, &set1->impl); }
00058
00059
00060 CU_SINLINE cu_hash_t cucon_uset_hash(cucon_uset_t set)
00061 { return cucon_umap_hash_keys(&set->impl); }
00062
00063
00064 CU_SINLINE size_t cucon_uset_size(cucon_uset_t set)
00065 { return cucon_umap_size(&set->impl); }
00066
00067
00068 CU_SINLINE cu_bool_t cucon_uset_is_empty(cucon_uset_t set)
00069 { return cucon_umap_is_empty(&set->impl); }
00070
00071
00072 CU_SINLINE cu_bool_t cucon_uset_insert(cucon_uset_t set, uintptr_t key)
00073 { return cucon_umap_insert_void(&set->impl, key); }
00074
00075
00076 CU_SINLINE cu_bool_t cucon_uset_erase(cucon_uset_t set, uintptr_t key)
00077 { return cucon_umap_erase(&set->impl, key); }
00078
00079
00080
00081
00082 CU_SINLINE cu_bool_t cucon_uset_erase_keep_cap(cucon_uset_t set, uintptr_t key)
00083 { return cucon_umap_erase_keep_cap(&set->impl, key); }
00084
00085
00086 CU_SINLINE void cucon_uset_update_cap(cucon_uset_t set)
00087 { cucon_umap_update_cap(&set->impl); }
00088
00089
00090
00091
00092 CU_SINLINE uintptr_t cucon_uset_pop_any(cucon_uset_t set)
00093 { return cucon_umap_pop_any_key(&set->impl); }
00094
00095
00096 CU_SINLINE cu_bool_t cucon_uset_find(cucon_uset_t set, uintptr_t key)
00097 { return cucon_umap_find_void(&set->impl, key); }
00098
00099
00100
00101 CU_SINLINE void
00102 cucon_uset_iter(cucon_uset_t set, cu_clop(cb, void, uintptr_t key))
00103 { cucon_umap_iter_keys(&set->impl, cb); }
00104
00105
00106
00107 CU_SINLINE void
00108 cucon_uset_iter_increasing(cucon_uset_t set, cu_clop(cb, void, uintptr_t key))
00109 { cucon_umap_iter_increasing_keys(&set->impl, cb); }
00110
00111
00112 CU_SINLINE cu_bool_t
00113 cucon_uset_conj(cucon_uset_t set, cu_clop(cb, cu_bool_t, uintptr_t key))
00114 { return cucon_umap_conj_keys(&set->impl, cb); }
00115
00116
00117
00118
00119
00120 CU_SINLINE void
00121 cucon_uset_assign_isecn_union(cucon_uset_t set0, cucon_uset_t set1)
00122 { cucon_umap_assign_isecn_union(&set0->impl, &set1->impl); }
00123
00124
00125
00126
00127 CU_SINLINE void
00128 cucon_uset_move_isecn(cucon_uset_t dst, cucon_uset_t src0, cucon_uset_t src1)
00129 { cucon_umap_move_isecn(&dst->impl, &src0->impl, &src1->impl); }
00130
00131
00132 CU_SINLINE void
00133 cucon_uset_assign_isecn(cucon_uset_t dst, cucon_uset_t src)
00134 { cucon_umap_assign_isecn(&dst->impl, &src->impl); }
00135
00136
00137 CU_SINLINE void
00138 cucon_uset_assign_union(cucon_uset_t dst, cucon_uset_t src)
00139 { cucon_umap_assign_union_void(&dst->impl, &src->impl); }
00140
00141
00142 CU_SINLINE void
00143 cucon_uset_print(cucon_uset_t set, FILE *out)
00144 { cucon_umap_print_keys(&set->impl, out); }
00145
00146 CU_SINLINE void
00147 cucon_uset_dump_stats(cucon_uset_t set, FILE *out)
00148 { cucon_umap_dump_stats(&set->impl, out); }
00149
00150
00151 #define cucon_uset_cct cucon_uset_init
00152
00153 #define cucon_uset_cct_copy cucon_uset_init_copy
00154
00155
00156 CU_END_DECLARATIONS
00157
00158 #endif