src/cx/map.h

changeset 694
ac827d873c17
parent 692
6ac92936cd44
child 706
8c6edaccaef1
equal deleted inserted replaced
693:494d9b20b99e 694:ac827d873c17
808 */ 808 */
809 #define cxMapPut(map, key, value) _Generic((key), \ 809 #define cxMapPut(map, key, value) _Generic((key), \
810 CxHashKey: cx_map_put, \ 810 CxHashKey: cx_map_put, \
811 cxstring: cx_map_put_cxstr, \ 811 cxstring: cx_map_put_cxstr, \
812 cxmutstr: cx_map_put_mustr, \ 812 cxmutstr: cx_map_put_mustr, \
813 char*: cx_map_put_str) \ 813 char*: cx_map_put_str, \
814 char const*: cx_map_put_str) \
814 (map, key, value) 815 (map, key, value)
815 816
816 /** 817 /**
817 * Retrieves a value by using a key. 818 * Retrieves a value by using a key.
818 * 819 *
882 */ 883 */
883 #define cxMapGet(map, key) _Generic((key), \ 884 #define cxMapGet(map, key) _Generic((key), \
884 CxHashKey: cx_map_get, \ 885 CxHashKey: cx_map_get, \
885 cxstring: cx_map_get_cxstr, \ 886 cxstring: cx_map_get_cxstr, \
886 cxmutstr: cx_map_get_mustr, \ 887 cxmutstr: cx_map_get_mustr, \
887 char*: cx_map_get_str) \ 888 char*: cx_map_get_str, \
889 char const*: cx_map_get_str) \
888 (map, key) 890 (map, key)
889 891
890 /** 892 /**
891 * Removes a key/value-pair from the map by using the key. 893 * Removes a key/value-pair from the map by using the key.
892 * 894 *
959 */ 961 */
960 #define cxMapRemove(map, key) _Generic((key), \ 962 #define cxMapRemove(map, key) _Generic((key), \
961 CxHashKey: cx_map_remove, \ 963 CxHashKey: cx_map_remove, \
962 cxstring: cx_map_remove_cxstr, \ 964 cxstring: cx_map_remove_cxstr, \
963 cxmutstr: cx_map_remove_mustr, \ 965 cxmutstr: cx_map_remove_mustr, \
964 char*: cx_map_remove_str) \ 966 char*: cx_map_remove_str, \
967 char const*: cx_map_remove_str) \
965 (map, key) 968 (map, key)
966 969
967 /** 970 /**
968 * Detaches a key/value-pair from the map by using the key 971 * Detaches a key/value-pair from the map by using the key
969 * without invoking the destructor. 972 * without invoking the destructor.
1040 */ 1043 */
1041 #define cxMapDetach(map, key) _Generic((key), \ 1044 #define cxMapDetach(map, key) _Generic((key), \
1042 CxHashKey: cx_map_detach, \ 1045 CxHashKey: cx_map_detach, \
1043 cxstring: cx_map_detach_cxstr, \ 1046 cxstring: cx_map_detach_cxstr, \
1044 cxmutstr: cx_map_detach_mustr, \ 1047 cxmutstr: cx_map_detach_mustr, \
1045 char*: cx_map_detach_str) \ 1048 char*: cx_map_detach_str, \
1049 char const*: cx_map_detach_str) \
1046 (map, key) 1050 (map, key)
1047 1051
1048 /** 1052 /**
1049 * Removes a key/value-pair from the map by using the key. 1053 * Removes a key/value-pair from the map by using the key.
1050 * 1054 *
1130 */ 1134 */
1131 #define cxMapRemoveAndGet(map, key) _Generic((key), \ 1135 #define cxMapRemoveAndGet(map, key) _Generic((key), \
1132 CxHashKey: cx_map_remove_and_get, \ 1136 CxHashKey: cx_map_remove_and_get, \
1133 cxstring: cx_map_remove_and_get_cxstr, \ 1137 cxstring: cx_map_remove_and_get_cxstr, \
1134 cxmutstr: cx_map_remove_and_get_mustr, \ 1138 cxmutstr: cx_map_remove_and_get_mustr, \
1135 char*: cx_map_remove_and_get_str) \ 1139 char*: cx_map_remove_and_get_str, \
1140 char const*: cx_map_remove_and_get_str) \
1136 (map, key) 1141 (map, key)
1137 1142
1138 #endif // __cplusplus 1143 #endif // __cplusplus
1139 1144
1140 #endif // UCX_MAP_H 1145 #endif // UCX_MAP_H

mercurial