00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CX_MAP_H
00029 #define CX_MAP_H
00030
00031 #include <cxmemory.h>
00032 #include <cxtree.h>
00033
00034 CX_BEGIN_DECLS
00035
00046 typedef cx_tree cx_map;
00047
00057 typedef cx_tree_iterator cx_map_iterator;
00058
00069 typedef cx_tree_const_iterator cx_map_const_iterator;
00070
00085 typedef cx_tree_compare_func cx_map_compare_func;
00086
00087
00088
00089
00090
00091
00092 cx_map *cx_map_new(cx_compare_func, cx_free_func, cx_free_func);
00093 void cx_map_delete(cx_map *);
00094
00095
00096
00097
00098
00099 cxsize cx_map_size(const cx_map *);
00100 cxbool cx_map_empty(const cx_map *);
00101 cxsize cx_map_max_size(const cx_map *);
00102 cx_map_compare_func cx_map_key_comp(const cx_map *);
00103
00104
00105
00106
00107
00108 cxsize cx_map_count(const cx_map *, cxcptr);
00109 cx_map_iterator cx_map_find(const cx_map *, cxcptr);
00110 cx_map_iterator cx_map_lower_bound(const cx_map *, cxcptr);
00111 cx_map_iterator cx_map_upper_bound(const cx_map *, cxcptr);
00112 void cx_map_equal_range(const cx_map *, cxcptr, cx_map_iterator *,
00113 cx_map_iterator *);
00114
00115
00116
00117
00118
00119 void cx_map_swap(cx_map *, cx_map *);
00120 cxptr cx_map_assign(cx_map *, cx_map_iterator, cxcptr);
00121 cxptr cx_map_put(cx_map *, cxcptr, cxcptr);
00122
00123
00124
00125
00126
00127 cxptr cx_map_get_key(const cx_map *, cx_map_const_iterator);
00128 cxptr cx_map_get_value(const cx_map *, cx_map_const_iterator);
00129 cxptr cx_map_get(cx_map *, cxcptr);
00130
00131
00132
00133
00134
00135 cx_map_iterator cx_map_begin(const cx_map *);
00136 cx_map_iterator cx_map_end(const cx_map *);
00137 cx_map_iterator cx_map_next(const cx_map *, cx_map_const_iterator);
00138 cx_map_iterator cx_map_previous(const cx_map *, cx_map_const_iterator);
00139
00140
00141
00142
00143
00144
00145 cx_map_iterator cx_map_insert(cx_map *, cxcptr, cxcptr);
00146 void cx_map_erase_position(cx_map *, cx_map_iterator);
00147 void cx_map_erase_range(cx_map *, cx_map_iterator, cx_map_iterator);
00148 cxsize cx_map_erase(cx_map *, cxcptr);
00149 void cx_map_clear(cx_map *);
00150
00151 CX_END_DECLS
00152
00153 #endif