src/cx/map.h

Sun, 21 May 2023 14:37:56 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 21 May 2023 14:37:56 +0200
changeset 706
8c6edaccaef1
parent 694
ac827d873c17
child 709
1e8ba59e7911
permissions
-rw-r--r--

add empty map implementation - fixes #259

universe@549 1 /*
universe@549 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@549 3 *
universe@549 4 * Copyright 2021 Mike Becker, Olaf Wintermann All rights reserved.
universe@549 5 *
universe@549 6 * Redistribution and use in source and binary forms, with or without
universe@549 7 * modification, are permitted provided that the following conditions are met:
universe@549 8 *
universe@549 9 * 1. Redistributions of source code must retain the above copyright
universe@549 10 * notice, this list of conditions and the following disclaimer.
universe@549 11 *
universe@549 12 * 2. Redistributions in binary form must reproduce the above copyright
universe@549 13 * notice, this list of conditions and the following disclaimer in the
universe@549 14 * documentation and/or other materials provided with the distribution.
universe@549 15 *
universe@549 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@549 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@549 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
universe@549 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
universe@549 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
universe@549 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
universe@549 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
universe@549 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
universe@549 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
universe@549 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
universe@549 26 * POSSIBILITY OF SUCH DAMAGE.
universe@549 27 */
universe@549 28 /**
universe@549 29 * \file map.h
universe@549 30 * \brief Interface for map implementations.
universe@549 31 * \author Mike Becker
universe@549 32 * \author Olaf Wintermann
universe@549 33 * \version 3.0
universe@549 34 * \copyright 2-Clause BSD License
universe@549 35 */
universe@549 36
universe@549 37 #ifndef UCX_MAP_H
universe@549 38 #define UCX_MAP_H
universe@549 39
universe@681 40 #include "common.h"
universe@677 41 #include "collection.h"
universe@691 42 #include "string.h"
universe@563 43 #include "hash_key.h"
universe@549 44
universe@549 45 #ifdef __cplusplus
universe@549 46 extern "C" {
universe@549 47 #endif
universe@549 48
universe@549 49 /** Type for the UCX map. */
universe@549 50 typedef struct cx_map_s CxMap;
universe@549 51
universe@549 52 /** Type for a map entry. */
universe@549 53 typedef struct cx_map_entry_s CxMapEntry;
universe@549 54
universe@549 55 /** Type for map class definitions. */
universe@549 56 typedef struct cx_map_class_s cx_map_class;
universe@549 57
universe@549 58 /** Structure for the UCX map. */
universe@549 59 struct cx_map_s {
universe@685 60 CX_COLLECTION_MEMBERS
universe@549 61 /** The map class definition. */
universe@549 62 cx_map_class *cl;
universe@549 63 };
universe@549 64
universe@549 65 /**
universe@549 66 * The class definition for arbitrary maps.
universe@549 67 */
universe@549 68 struct cx_map_class_s {
universe@549 69 /**
universe@549 70 * Deallocates the entire memory.
universe@549 71 */
universe@549 72 __attribute__((__nonnull__))
universe@549 73 void (*destructor)(struct cx_map_s *map);
universe@549 74
universe@549 75 /**
universe@549 76 * Removes all elements.
universe@549 77 */
universe@549 78 __attribute__((__nonnull__))
universe@549 79 void (*clear)(struct cx_map_s *map);
universe@549 80
universe@549 81 /**
universe@549 82 * Add or overwrite an element.
universe@549 83 */
universe@549 84 __attribute__((__nonnull__))
universe@549 85 int (*put)(
universe@549 86 CxMap *map,
universe@563 87 CxHashKey key,
universe@550 88 void *value
universe@549 89 );
universe@549 90
universe@549 91 /**
universe@549 92 * Returns an element.
universe@549 93 */
universe@549 94 __attribute__((__nonnull__, __warn_unused_result__))
universe@549 95 void *(*get)(
universe@549 96 CxMap const *map,
universe@563 97 CxHashKey key
universe@549 98 );
universe@549 99
universe@549 100 /**
universe@549 101 * Removes an element.
universe@549 102 */
universe@659 103 __attribute__((__nonnull__))
universe@549 104 void *(*remove)(
universe@550 105 CxMap *map,
universe@686 106 CxHashKey key,
universe@686 107 bool destroy
universe@549 108 );
universe@549 109
universe@549 110 /**
universe@549 111 * Iterator over the key/value pairs.
universe@549 112 */
universe@549 113 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 114 CxIterator (*iterator)(CxMap const *map);
universe@549 115
universe@549 116 /**
universe@549 117 * Iterator over the keys.
universe@549 118 */
universe@549 119 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 120 CxIterator (*iterator_keys)(CxMap const *map);
universe@549 121
universe@549 122 /**
universe@549 123 * Iterator over the values.
universe@549 124 */
universe@549 125 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 126 CxIterator (*iterator_values)(CxMap const *map);
universe@630 127
universe@630 128 /**
universe@630 129 * Mutating iterator over the key/value pairs.
universe@630 130 */
universe@630 131 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 132 CxMutIterator (*mut_iterator)(CxMap *map);
universe@630 133
universe@630 134 /**
universe@630 135 * Mutating iterator over the keys.
universe@630 136 */
universe@630 137 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 138 CxMutIterator (*mut_iterator_keys)(CxMap *map);
universe@630 139
universe@630 140 /**
universe@630 141 * Mutating iterator over the values.
universe@630 142 */
universe@630 143 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 144 CxMutIterator (*mut_iterator_values)(CxMap *map);
universe@549 145 };
universe@549 146
universe@549 147 /**
universe@549 148 * A map entry.
universe@549 149 */
universe@549 150 struct cx_map_entry_s {
universe@549 151 /**
universe@551 152 * A pointer to the key.
universe@549 153 */
universe@563 154 CxHashKey const *key;
universe@549 155 /**
universe@551 156 * A pointer to the value.
universe@549 157 */
universe@551 158 void *value;
universe@549 159 };
universe@549 160
universe@706 161 extern CxMap *const cxEmptyMap;
universe@706 162
universe@658 163 /**
universe@658 164 * Advises the map to store copies of the objects (default mode of operation).
universe@658 165 *
universe@658 166 * Retrieving objects from this map will yield pointers to the copies stored
universe@658 167 * within this list.
universe@658 168 *
universe@658 169 * @param map the map
universe@658 170 * @see cxMapStorePointers()
universe@658 171 */
universe@658 172 __attribute__((__nonnull__))
universe@658 173 static inline void cxMapStoreObjects(CxMap *map) {
universe@685 174 map->store_pointer = false;
universe@658 175 }
universe@658 176
universe@658 177 /**
universe@658 178 * Advises the map to only store pointers to the objects.
universe@658 179 *
universe@658 180 * Retrieving objects from this list will yield the original pointers stored.
universe@658 181 *
universe@658 182 * @note This function forcibly sets the element size to the size of a pointer.
universe@658 183 * Invoking this function on a non-empty map that already stores copies of
universe@658 184 * objects is undefined.
universe@658 185 *
universe@658 186 * @param map the map
universe@658 187 * @see cxMapStoreObjects()
universe@658 188 */
universe@658 189 __attribute__((__nonnull__))
universe@658 190 static inline void cxMapStorePointers(CxMap *map) {
universe@685 191 map->store_pointer = true;
universe@677 192 map->item_size = sizeof(void *);
universe@658 193 }
universe@658 194
universe@549 195
universe@549 196 /**
universe@549 197 * Deallocates the memory of the specified map.
universe@549 198 *
universe@549 199 * @param map the map to be destroyed
universe@549 200 */
universe@549 201 __attribute__((__nonnull__))
universe@549 202 static inline void cxMapDestroy(CxMap *map) {
universe@549 203 map->cl->destructor(map);
universe@549 204 }
universe@549 205
universe@549 206
universe@549 207 /**
universe@549 208 * Clears a map by removing all elements.
universe@549 209 *
universe@549 210 * @param map the map to be cleared
universe@549 211 */
universe@549 212 __attribute__((__nonnull__))
universe@549 213 static inline void cxMapClear(CxMap *map) {
universe@549 214 map->cl->clear(map);
universe@549 215 }
universe@549 216
universe@549 217
universe@549 218 // TODO: set-like map operations (union, intersect, difference)
universe@549 219
universe@549 220 /**
universe@549 221 * Creates a value iterator for a map.
universe@549 222 *
universe@549 223 * \note An iterator iterates over all elements successively. Therefore the order
universe@549 224 * highly depends on the map implementation and may change arbitrarily when the contents change.
universe@549 225 *
universe@549 226 * @param map the map to create the iterator for
universe@549 227 * @return an iterator for the currently stored values
universe@549 228 */
universe@549 229 __attribute__((__nonnull__, __warn_unused_result__))
universe@551 230 static inline CxIterator cxMapIteratorValues(CxMap *map) {
universe@549 231 return map->cl->iterator_values(map);
universe@549 232 }
universe@549 233
universe@549 234 /**
universe@549 235 * Creates a key iterator for a map.
universe@549 236 *
universe@564 237 * The elements of the iterator are keys of type CxHashKey.
universe@555 238 *
universe@549 239 * \note An iterator iterates over all elements successively. Therefore the order
universe@549 240 * highly depends on the map implementation and may change arbitrarily when the contents change.
universe@549 241 *
universe@549 242 * @param map the map to create the iterator for
universe@549 243 * @return an iterator for the currently stored keys
universe@549 244 */
universe@549 245 __attribute__((__nonnull__, __warn_unused_result__))
universe@551 246 static inline CxIterator cxMapIteratorKeys(CxMap *map) {
universe@549 247 return map->cl->iterator_keys(map);
universe@549 248 }
universe@549 249
universe@549 250 /**
universe@549 251 * Creates an iterator for a map.
universe@549 252 *
universe@555 253 * The elements of the iterator are key/value pairs of type CxMapEntry.
universe@549 254 *
universe@549 255 * \note An iterator iterates over all elements successively. Therefore the order
universe@549 256 * highly depends on the map implementation and may change arbitrarily when the contents change.
universe@549 257 *
universe@549 258 * @param map the map to create the iterator for
universe@555 259 * @return an iterator for the currently stored entries
universe@549 260 * @see cxMapIteratorKeys()
universe@549 261 * @see cxMapIteratorValues()
universe@549 262 */
universe@549 263 __attribute__((__nonnull__, __warn_unused_result__))
universe@551 264 static inline CxIterator cxMapIterator(CxMap *map) {
universe@549 265 return map->cl->iterator(map);
universe@549 266 }
universe@549 267
universe@630 268
universe@630 269 /**
universe@630 270 * Creates a mutating iterator over the values of a map.
universe@630 271 *
universe@630 272 * \note An iterator iterates over all elements successively. Therefore the order
universe@630 273 * highly depends on the map implementation and may change arbitrarily when the contents change.
universe@630 274 *
universe@630 275 * @param map the map to create the iterator for
universe@630 276 * @return an iterator for the currently stored values
universe@630 277 */
universe@630 278 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 279 static inline CxMutIterator cxMapMutIteratorValues(CxMap *map) {
universe@630 280 return map->cl->mut_iterator_values(map);
universe@630 281 }
universe@630 282
universe@630 283 /**
universe@630 284 * Creates a mutating iterator over the keys of a map.
universe@630 285 *
universe@630 286 * The elements of the iterator are keys of type CxHashKey.
universe@630 287 *
universe@630 288 * \note An iterator iterates over all elements successively. Therefore the order
universe@630 289 * highly depends on the map implementation and may change arbitrarily when the contents change.
universe@630 290 *
universe@630 291 * @param map the map to create the iterator for
universe@630 292 * @return an iterator for the currently stored keys
universe@630 293 */
universe@630 294 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 295 static inline CxMutIterator cxMapMutIteratorKeys(CxMap *map) {
universe@630 296 return map->cl->mut_iterator_keys(map);
universe@630 297 }
universe@630 298
universe@630 299 /**
universe@630 300 * Creates a mutating iterator for a map.
universe@630 301 *
universe@630 302 * The elements of the iterator are key/value pairs of type CxMapEntry.
universe@630 303 *
universe@630 304 * \note An iterator iterates over all elements successively. Therefore the order
universe@630 305 * highly depends on the map implementation and may change arbitrarily when the contents change.
universe@630 306 *
universe@630 307 * @param map the map to create the iterator for
universe@630 308 * @return an iterator for the currently stored entries
universe@630 309 * @see cxMapMutIteratorKeys()
universe@630 310 * @see cxMapMutIteratorValues()
universe@630 311 */
universe@630 312 __attribute__((__nonnull__, __warn_unused_result__))
universe@630 313 static inline CxMutIterator cxMapMutIterator(CxMap *map) {
universe@630 314 return map->cl->mut_iterator(map);
universe@630 315 }
universe@630 316
universe@691 317 #ifdef __cplusplus
universe@691 318 } // end the extern "C" block here, because we want to start overloading
universe@691 319
universe@691 320 /**
universe@691 321 * Puts a key/value-pair into the map.
universe@691 322 *
universe@691 323 * @param map the map
universe@691 324 * @param key the key
universe@691 325 * @param value the value
universe@691 326 * @return 0 on success, non-zero value on failure
universe@691 327 */
universe@691 328 __attribute__((__nonnull__))
universe@691 329 static inline int cxMapPut(
universe@691 330 CxMap *map,
universe@691 331 CxHashKey const &key,
universe@691 332 void *value
universe@691 333 ) {
universe@691 334 return map->cl->put(map, key, value);
universe@549 335 }
universe@549 336
universe@691 337
universe@691 338 /**
universe@691 339 * Puts a key/value-pair into the map.
universe@691 340 *
universe@691 341 * @param map the map
universe@691 342 * @param key the key
universe@691 343 * @param value the value
universe@691 344 * @return 0 on success, non-zero value on failure
universe@691 345 */
universe@691 346 __attribute__((__nonnull__))
universe@691 347 static inline int cxMapPut(
universe@691 348 CxMap *map,
universe@691 349 cxstring const &key,
universe@691 350 void *value
universe@691 351 ) {
universe@691 352 return map->cl->put(map, cx_hash_key_cxstr(key), value);
universe@691 353 }
universe@691 354
universe@691 355 /**
universe@691 356 * Puts a key/value-pair into the map.
universe@691 357 *
universe@691 358 * @param map the map
universe@691 359 * @param key the key
universe@691 360 * @param value the value
universe@691 361 * @return 0 on success, non-zero value on failure
universe@691 362 */
universe@691 363 __attribute__((__nonnull__))
universe@691 364 static inline int cxMapPut(
universe@691 365 CxMap *map,
universe@692 366 cxmutstr const &key,
universe@692 367 void *value
universe@692 368 ) {
universe@692 369 return map->cl->put(map, cx_hash_key_cxstr(key), value);
universe@692 370 }
universe@692 371
universe@692 372 /**
universe@692 373 * Puts a key/value-pair into the map.
universe@692 374 *
universe@692 375 * @param map the map
universe@692 376 * @param key the key
universe@692 377 * @param value the value
universe@692 378 * @return 0 on success, non-zero value on failure
universe@692 379 */
universe@692 380 __attribute__((__nonnull__))
universe@692 381 static inline int cxMapPut(
universe@692 382 CxMap *map,
universe@691 383 char const *key,
universe@691 384 void *value
universe@691 385 ) {
universe@691 386 return map->cl->put(map, cx_hash_key_str(key), value);
universe@691 387 }
universe@691 388
universe@691 389 /**
universe@691 390 * Retrieves a value by using a key.
universe@691 391 *
universe@691 392 * @param map the map
universe@691 393 * @param key the key
universe@691 394 * @return the value
universe@691 395 */
universe@691 396 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 397 static inline void *cxMapGet(
universe@691 398 CxMap const *map,
universe@691 399 CxHashKey const &key
universe@691 400 ) {
universe@691 401 return map->cl->get(map, key);
universe@691 402 }
universe@691 403
universe@691 404 /**
universe@691 405 * Retrieves a value by using a key.
universe@691 406 *
universe@691 407 * @param map the map
universe@691 408 * @param key the key
universe@691 409 * @return the value
universe@691 410 */
universe@691 411 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 412 static inline void *cxMapGet(
universe@691 413 CxMap const *map,
universe@691 414 cxstring const &key
universe@691 415 ) {
universe@691 416 return map->cl->get(map, cx_hash_key_cxstr(key));
universe@691 417 }
universe@691 418
universe@691 419 /**
universe@691 420 * Retrieves a value by using a key.
universe@691 421 *
universe@691 422 * @param map the map
universe@691 423 * @param key the key
universe@691 424 * @return the value
universe@691 425 */
universe@691 426 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 427 static inline void *cxMapGet(
universe@691 428 CxMap const *map,
universe@692 429 cxmutstr const &key
universe@692 430 ) {
universe@692 431 return map->cl->get(map, cx_hash_key_cxstr(key));
universe@692 432 }
universe@692 433
universe@692 434 /**
universe@692 435 * Retrieves a value by using a key.
universe@692 436 *
universe@692 437 * @param map the map
universe@692 438 * @param key the key
universe@692 439 * @return the value
universe@692 440 */
universe@692 441 __attribute__((__nonnull__, __warn_unused_result__))
universe@692 442 static inline void *cxMapGet(
universe@692 443 CxMap const *map,
universe@691 444 char const *key
universe@691 445 ) {
universe@691 446 return map->cl->get(map, cx_hash_key_str(key));
universe@691 447 }
universe@691 448
universe@691 449 /**
universe@691 450 * Removes a key/value-pair from the map by using the key.
universe@691 451 *
universe@691 452 * Always invokes the destructor function, if any, on the removed element.
universe@691 453 * If this map is storing pointers and you just want to retrieve the pointer
universe@691 454 * without invoking the destructor, use cxMapRemoveAndGet().
universe@691 455 * If you just want to detach the element from the map without invoking the
universe@691 456 * destructor or returning the element, use cxMapDetach().
universe@691 457 *
universe@691 458 * @param map the map
universe@691 459 * @param key the key
universe@691 460 * @see cxMapRemoveAndGet()
universe@691 461 * @see cxMapDetach()
universe@691 462 */
universe@691 463 __attribute__((__nonnull__))
universe@691 464 static inline void cxMapRemove(
universe@691 465 CxMap *map,
universe@691 466 CxHashKey const &key
universe@691 467 ) {
universe@691 468 (void) map->cl->remove(map, key, true);
universe@691 469 }
universe@691 470
universe@691 471 /**
universe@691 472 * Removes a key/value-pair from the map by using the key.
universe@691 473 *
universe@691 474 * Always invokes the destructor function, if any, on the removed element.
universe@691 475 * If this map is storing pointers and you just want to retrieve the pointer
universe@691 476 * without invoking the destructor, use cxMapRemoveAndGet().
universe@691 477 * If you just want to detach the element from the map without invoking the
universe@691 478 * destructor or returning the element, use cxMapDetach().
universe@691 479 *
universe@691 480 * @param map the map
universe@691 481 * @param key the key
universe@691 482 * @see cxMapRemoveAndGet()
universe@691 483 * @see cxMapDetach()
universe@691 484 */
universe@691 485 __attribute__((__nonnull__))
universe@691 486 static inline void cxMapRemove(
universe@691 487 CxMap *map,
universe@691 488 cxstring const &key
universe@691 489 ) {
universe@691 490 (void) map->cl->remove(map, cx_hash_key_cxstr(key), true);
universe@691 491 }
universe@691 492
universe@691 493 /**
universe@691 494 * Removes a key/value-pair from the map by using the key.
universe@691 495 *
universe@691 496 * Always invokes the destructor function, if any, on the removed element.
universe@691 497 * If this map is storing pointers and you just want to retrieve the pointer
universe@691 498 * without invoking the destructor, use cxMapRemoveAndGet().
universe@691 499 * If you just want to detach the element from the map without invoking the
universe@691 500 * destructor or returning the element, use cxMapDetach().
universe@691 501 *
universe@691 502 * @param map the map
universe@691 503 * @param key the key
universe@691 504 * @see cxMapRemoveAndGet()
universe@691 505 * @see cxMapDetach()
universe@691 506 */
universe@691 507 __attribute__((__nonnull__))
universe@691 508 static inline void cxMapRemove(
universe@691 509 CxMap *map,
universe@692 510 cxmutstr const &key
universe@692 511 ) {
universe@692 512 (void) map->cl->remove(map, cx_hash_key_cxstr(key), true);
universe@692 513 }
universe@692 514
universe@692 515 /**
universe@692 516 * Removes a key/value-pair from the map by using the key.
universe@692 517 *
universe@692 518 * Always invokes the destructor function, if any, on the removed element.
universe@692 519 * If this map is storing pointers and you just want to retrieve the pointer
universe@692 520 * without invoking the destructor, use cxMapRemoveAndGet().
universe@692 521 * If you just want to detach the element from the map without invoking the
universe@692 522 * destructor or returning the element, use cxMapDetach().
universe@692 523 *
universe@692 524 * @param map the map
universe@692 525 * @param key the key
universe@692 526 * @see cxMapRemoveAndGet()
universe@692 527 * @see cxMapDetach()
universe@692 528 */
universe@692 529 __attribute__((__nonnull__))
universe@692 530 static inline void cxMapRemove(
universe@692 531 CxMap *map,
universe@691 532 char const *key
universe@691 533 ) {
universe@691 534 (void) map->cl->remove(map, cx_hash_key_str(key), true);
universe@691 535 }
universe@691 536
universe@691 537 /**
universe@691 538 * Detaches a key/value-pair from the map by using the key
universe@691 539 * without invoking the destructor.
universe@691 540 *
universe@691 541 * In general, you should only use this function if the map does not own
universe@691 542 * the data and there is a valid reference to the data somewhere else
universe@691 543 * in the program. In all other cases it is preferable to use
universe@691 544 * cxMapRemove() or cxMapRemoveAndGet().
universe@691 545 *
universe@691 546 * @param map the map
universe@691 547 * @param key the key
universe@691 548 * @see cxMapRemove()
universe@691 549 * @see cxMapRemoveAndGet()
universe@691 550 */
universe@691 551 __attribute__((__nonnull__))
universe@691 552 static inline void cxMapDetach(
universe@691 553 CxMap *map,
universe@691 554 CxHashKey const &key
universe@691 555 ) {
universe@691 556 (void) map->cl->remove(map, key, false);
universe@691 557 }
universe@691 558
universe@691 559 /**
universe@691 560 * Detaches a key/value-pair from the map by using the key
universe@691 561 * without invoking the destructor.
universe@691 562 *
universe@691 563 * In general, you should only use this function if the map does not own
universe@691 564 * the data and there is a valid reference to the data somewhere else
universe@691 565 * in the program. In all other cases it is preferable to use
universe@691 566 * cxMapRemove() or cxMapRemoveAndGet().
universe@691 567 *
universe@691 568 * @param map the map
universe@691 569 * @param key the key
universe@691 570 * @see cxMapRemove()
universe@691 571 * @see cxMapRemoveAndGet()
universe@691 572 */
universe@691 573 __attribute__((__nonnull__))
universe@691 574 static inline void cxMapDetach(
universe@691 575 CxMap *map,
universe@691 576 cxstring const &key
universe@691 577 ) {
universe@691 578 (void) map->cl->remove(map, cx_hash_key_cxstr(key), false);
universe@691 579 }
universe@691 580
universe@691 581 /**
universe@691 582 * Detaches a key/value-pair from the map by using the key
universe@691 583 * without invoking the destructor.
universe@691 584 *
universe@691 585 * In general, you should only use this function if the map does not own
universe@691 586 * the data and there is a valid reference to the data somewhere else
universe@691 587 * in the program. In all other cases it is preferable to use
universe@691 588 * cxMapRemove() or cxMapRemoveAndGet().
universe@691 589 *
universe@691 590 * @param map the map
universe@691 591 * @param key the key
universe@691 592 * @see cxMapRemove()
universe@691 593 * @see cxMapRemoveAndGet()
universe@691 594 */
universe@691 595 __attribute__((__nonnull__))
universe@691 596 static inline void cxMapDetach(
universe@691 597 CxMap *map,
universe@692 598 cxmutstr const &key
universe@692 599 ) {
universe@692 600 (void) map->cl->remove(map, cx_hash_key_cxstr(key), false);
universe@692 601 }
universe@692 602
universe@692 603 /**
universe@692 604 * Detaches a key/value-pair from the map by using the key
universe@692 605 * without invoking the destructor.
universe@692 606 *
universe@692 607 * In general, you should only use this function if the map does not own
universe@692 608 * the data and there is a valid reference to the data somewhere else
universe@692 609 * in the program. In all other cases it is preferable to use
universe@692 610 * cxMapRemove() or cxMapRemoveAndGet().
universe@692 611 *
universe@692 612 * @param map the map
universe@692 613 * @param key the key
universe@692 614 * @see cxMapRemove()
universe@692 615 * @see cxMapRemoveAndGet()
universe@692 616 */
universe@692 617 __attribute__((__nonnull__))
universe@692 618 static inline void cxMapDetach(
universe@692 619 CxMap *map,
universe@691 620 char const *key
universe@691 621 ) {
universe@691 622 (void) map->cl->remove(map, cx_hash_key_str(key), false);
universe@691 623 }
universe@691 624
universe@691 625 /**
universe@691 626 * Removes a key/value-pair from the map by using the key.
universe@691 627 *
universe@691 628 * This function can be used when the map is storing pointers,
universe@691 629 * in order to retrieve the pointer from the map without invoking
universe@691 630 * any destructor function. Sometimes you do not want the pointer
universe@691 631 * to be returned - in that case (instead of suppressing the "unused
universe@691 632 * result" warning) you can use cxMapDetach().
universe@691 633 *
universe@691 634 * If this map is not storing pointers, this function behaves like
universe@691 635 * cxMapRemove() and returns \c NULL.
universe@691 636 *
universe@691 637 * @param map the map
universe@691 638 * @param key the key
universe@691 639 * @return the stored pointer or \c NULL if either the key is not present
universe@691 640 * in the map or the map is not storing pointers
universe@691 641 * @see cxMapStorePointers()
universe@691 642 * @see cxMapDetach()
universe@691 643 */
universe@691 644 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 645 static inline void *cxMapRemoveAndGet(
universe@691 646 CxMap *map,
universe@691 647 CxHashKey key
universe@691 648 ) {
universe@691 649 return map->cl->remove(map, key, !map->store_pointer);
universe@691 650 }
universe@691 651
universe@691 652 /**
universe@691 653 * Removes a key/value-pair from the map by using the key.
universe@691 654 *
universe@691 655 * This function can be used when the map is storing pointers,
universe@691 656 * in order to retrieve the pointer from the map without invoking
universe@691 657 * any destructor function. Sometimes you do not want the pointer
universe@691 658 * to be returned - in that case (instead of suppressing the "unused
universe@691 659 * result" warning) you can use cxMapDetach().
universe@691 660 *
universe@691 661 * If this map is not storing pointers, this function behaves like
universe@691 662 * cxMapRemove() and returns \c NULL.
universe@691 663 *
universe@691 664 * @param map the map
universe@691 665 * @param key the key
universe@691 666 * @return the stored pointer or \c NULL if either the key is not present
universe@691 667 * in the map or the map is not storing pointers
universe@691 668 * @see cxMapStorePointers()
universe@691 669 * @see cxMapDetach()
universe@691 670 */
universe@691 671 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 672 static inline void *cxMapRemoveAndGet(
universe@691 673 CxMap *map,
universe@691 674 cxstring key
universe@691 675 ) {
universe@691 676 return map->cl->remove(map, cx_hash_key_cxstr(key), !map->store_pointer);
universe@691 677 }
universe@691 678
universe@691 679 /**
universe@691 680 * Removes a key/value-pair from the map by using the key.
universe@691 681 *
universe@691 682 * This function can be used when the map is storing pointers,
universe@691 683 * in order to retrieve the pointer from the map without invoking
universe@691 684 * any destructor function. Sometimes you do not want the pointer
universe@691 685 * to be returned - in that case (instead of suppressing the "unused
universe@691 686 * result" warning) you can use cxMapDetach().
universe@691 687 *
universe@691 688 * If this map is not storing pointers, this function behaves like
universe@691 689 * cxMapRemove() and returns \c NULL.
universe@691 690 *
universe@691 691 * @param map the map
universe@691 692 * @param key the key
universe@691 693 * @return the stored pointer or \c NULL if either the key is not present
universe@691 694 * in the map or the map is not storing pointers
universe@691 695 * @see cxMapStorePointers()
universe@691 696 * @see cxMapDetach()
universe@691 697 */
universe@691 698 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 699 static inline void *cxMapRemoveAndGet(
universe@691 700 CxMap *map,
universe@692 701 cxmutstr key
universe@692 702 ) {
universe@692 703 return map->cl->remove(map, cx_hash_key_cxstr(key), !map->store_pointer);
universe@692 704 }
universe@692 705
universe@692 706 /**
universe@692 707 * Removes a key/value-pair from the map by using the key.
universe@692 708 *
universe@692 709 * This function can be used when the map is storing pointers,
universe@692 710 * in order to retrieve the pointer from the map without invoking
universe@692 711 * any destructor function. Sometimes you do not want the pointer
universe@692 712 * to be returned - in that case (instead of suppressing the "unused
universe@692 713 * result" warning) you can use cxMapDetach().
universe@692 714 *
universe@692 715 * If this map is not storing pointers, this function behaves like
universe@692 716 * cxMapRemove() and returns \c NULL.
universe@692 717 *
universe@692 718 * @param map the map
universe@692 719 * @param key the key
universe@692 720 * @return the stored pointer or \c NULL if either the key is not present
universe@692 721 * in the map or the map is not storing pointers
universe@692 722 * @see cxMapStorePointers()
universe@692 723 * @see cxMapDetach()
universe@692 724 */
universe@692 725 __attribute__((__nonnull__, __warn_unused_result__))
universe@692 726 static inline void *cxMapRemoveAndGet(
universe@692 727 CxMap *map,
universe@691 728 char const *key
universe@691 729 ) {
universe@691 730 return map->cl->remove(map, cx_hash_key_str(key), !map->store_pointer);
universe@691 731 }
universe@691 732
universe@691 733 #else // __cplusplus
universe@691 734
universe@691 735 /**
universe@691 736 * Puts a key/value-pair into the map.
universe@691 737 *
universe@691 738 * @param map the map
universe@691 739 * @param key the key
universe@691 740 * @param value the value
universe@691 741 * @return 0 on success, non-zero value on failure
universe@691 742 */
universe@691 743 __attribute__((__nonnull__))
universe@691 744 static inline int cx_map_put(
universe@691 745 CxMap *map,
universe@691 746 CxHashKey key,
universe@691 747 void *value
universe@691 748 ) {
universe@691 749 return map->cl->put(map, key, value);
universe@691 750 }
universe@691 751
universe@691 752 /**
universe@691 753 * Puts a key/value-pair into the map.
universe@691 754 *
universe@691 755 * @param map the map
universe@691 756 * @param key the key
universe@691 757 * @param value the value
universe@691 758 * @return 0 on success, non-zero value on failure
universe@691 759 */
universe@691 760 __attribute__((__nonnull__))
universe@691 761 static inline int cx_map_put_cxstr(
universe@691 762 CxMap *map,
universe@691 763 cxstring key,
universe@691 764 void *value
universe@691 765 ) {
universe@691 766 return map->cl->put(map, cx_hash_key_cxstr(key), value);
universe@691 767 }
universe@691 768
universe@691 769 /**
universe@691 770 * Puts a key/value-pair into the map.
universe@691 771 *
universe@691 772 * @param map the map
universe@691 773 * @param key the key
universe@691 774 * @param value the value
universe@691 775 * @return 0 on success, non-zero value on failure
universe@691 776 */
universe@691 777 __attribute__((__nonnull__))
universe@692 778 static inline int cx_map_put_mustr(
universe@692 779 CxMap *map,
universe@692 780 cxmutstr key,
universe@692 781 void *value
universe@692 782 ) {
universe@692 783 return map->cl->put(map, cx_hash_key_cxstr(key), value);
universe@692 784 }
universe@692 785
universe@692 786 /**
universe@692 787 * Puts a key/value-pair into the map.
universe@692 788 *
universe@692 789 * @param map the map
universe@692 790 * @param key the key
universe@692 791 * @param value the value
universe@692 792 * @return 0 on success, non-zero value on failure
universe@692 793 */
universe@692 794 __attribute__((__nonnull__))
universe@691 795 static inline int cx_map_put_str(
universe@691 796 CxMap *map,
universe@691 797 char const *key,
universe@691 798 void *value
universe@691 799 ) {
universe@691 800 return map->cl->put(map, cx_hash_key_str(key), value);
universe@691 801 }
universe@691 802
universe@691 803 /**
universe@691 804 * Puts a key/value-pair into the map.
universe@691 805 *
universe@691 806 * @param map the map
universe@691 807 * @param key the key
universe@691 808 * @param value the value
universe@691 809 * @return 0 on success, non-zero value on failure
universe@691 810 */
universe@691 811 #define cxMapPut(map, key, value) _Generic((key), \
universe@691 812 CxHashKey: cx_map_put, \
universe@691 813 cxstring: cx_map_put_cxstr, \
universe@692 814 cxmutstr: cx_map_put_mustr, \
universe@694 815 char*: cx_map_put_str, \
universe@694 816 char const*: cx_map_put_str) \
universe@691 817 (map, key, value)
universe@691 818
universe@691 819 /**
universe@691 820 * Retrieves a value by using a key.
universe@691 821 *
universe@691 822 * @param map the map
universe@691 823 * @param key the key
universe@691 824 * @return the value
universe@691 825 */
universe@691 826 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 827 static inline void *cx_map_get(
universe@691 828 CxMap const *map,
universe@691 829 CxHashKey key
universe@691 830 ) {
universe@691 831 return map->cl->get(map, key);
universe@691 832 }
universe@691 833
universe@691 834 /**
universe@691 835 * Retrieves a value by using a key.
universe@691 836 *
universe@691 837 * @param map the map
universe@691 838 * @param key the key
universe@691 839 * @return the value
universe@691 840 */
universe@691 841 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 842 static inline void *cx_map_get_cxstr(
universe@691 843 CxMap const *map,
universe@691 844 cxstring key
universe@691 845 ) {
universe@691 846 return map->cl->get(map, cx_hash_key_cxstr(key));
universe@691 847 }
universe@691 848
universe@691 849 /**
universe@691 850 * Retrieves a value by using a key.
universe@691 851 *
universe@691 852 * @param map the map
universe@691 853 * @param key the key
universe@691 854 * @return the value
universe@691 855 */
universe@691 856 __attribute__((__nonnull__, __warn_unused_result__))
universe@692 857 static inline void *cx_map_get_mustr(
universe@692 858 CxMap const *map,
universe@692 859 cxmutstr key
universe@692 860 ) {
universe@692 861 return map->cl->get(map, cx_hash_key_cxstr(key));
universe@692 862 }
universe@692 863
universe@692 864 /**
universe@692 865 * Retrieves a value by using a key.
universe@692 866 *
universe@692 867 * @param map the map
universe@692 868 * @param key the key
universe@692 869 * @return the value
universe@692 870 */
universe@692 871 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 872 static inline void *cx_map_get_str(
universe@691 873 CxMap const *map,
universe@691 874 char const *key
universe@691 875 ) {
universe@691 876 return map->cl->get(map, cx_hash_key_str(key));
universe@691 877 }
universe@691 878
universe@691 879 /**
universe@691 880 * Retrieves a value by using a key.
universe@691 881 *
universe@691 882 * @param map the map
universe@691 883 * @param key the key
universe@691 884 * @return the value
universe@691 885 */
universe@691 886 #define cxMapGet(map, key) _Generic((key), \
universe@691 887 CxHashKey: cx_map_get, \
universe@691 888 cxstring: cx_map_get_cxstr, \
universe@692 889 cxmutstr: cx_map_get_mustr, \
universe@694 890 char*: cx_map_get_str, \
universe@694 891 char const*: cx_map_get_str) \
universe@691 892 (map, key)
universe@691 893
universe@691 894 /**
universe@691 895 * Removes a key/value-pair from the map by using the key.
universe@691 896 *
universe@691 897 * @param map the map
universe@691 898 * @param key the key
universe@691 899 */
universe@691 900 __attribute__((__nonnull__))
universe@691 901 static inline void cx_map_remove(
universe@691 902 CxMap *map,
universe@691 903 CxHashKey key
universe@691 904 ) {
universe@691 905 (void) map->cl->remove(map, key, true);
universe@691 906 }
universe@691 907
universe@691 908 /**
universe@691 909 * Removes a key/value-pair from the map by using the key.
universe@691 910 *
universe@691 911 * @param map the map
universe@691 912 * @param key the key
universe@691 913 */
universe@691 914 __attribute__((__nonnull__))
universe@691 915 static inline void cx_map_remove_cxstr(
universe@691 916 CxMap *map,
universe@691 917 cxstring key
universe@691 918 ) {
universe@691 919 (void) map->cl->remove(map, cx_hash_key_cxstr(key), true);
universe@691 920 }
universe@691 921
universe@691 922 /**
universe@691 923 * Removes a key/value-pair from the map by using the key.
universe@691 924 *
universe@691 925 * @param map the map
universe@691 926 * @param key the key
universe@691 927 */
universe@691 928 __attribute__((__nonnull__))
universe@692 929 static inline void cx_map_remove_mustr(
universe@692 930 CxMap *map,
universe@692 931 cxmutstr key
universe@692 932 ) {
universe@692 933 (void) map->cl->remove(map, cx_hash_key_cxstr(key), true);
universe@692 934 }
universe@692 935
universe@692 936 /**
universe@692 937 * Removes a key/value-pair from the map by using the key.
universe@692 938 *
universe@692 939 * @param map the map
universe@692 940 * @param key the key
universe@692 941 */
universe@692 942 __attribute__((__nonnull__))
universe@691 943 static inline void cx_map_remove_str(
universe@691 944 CxMap *map,
universe@691 945 char const *key
universe@691 946 ) {
universe@691 947 (void) map->cl->remove(map, cx_hash_key_str(key), true);
universe@691 948 }
universe@691 949
universe@691 950 /**
universe@691 951 * Removes a key/value-pair from the map by using the key.
universe@691 952 *
universe@691 953 * Always invokes the destructor function, if any, on the removed element.
universe@691 954 * If this map is storing pointers and you just want to retrieve the pointer
universe@691 955 * without invoking the destructor, use cxMapRemoveAndGet().
universe@691 956 * If you just want to detach the element from the map without invoking the
universe@691 957 * destructor or returning the element, use cxMapDetach().
universe@691 958 *
universe@691 959 * @param map the map
universe@691 960 * @param key the key
universe@691 961 * @see cxMapRemoveAndGet()
universe@691 962 * @see cxMapDetach()
universe@691 963 */
universe@691 964 #define cxMapRemove(map, key) _Generic((key), \
universe@691 965 CxHashKey: cx_map_remove, \
universe@691 966 cxstring: cx_map_remove_cxstr, \
universe@692 967 cxmutstr: cx_map_remove_mustr, \
universe@694 968 char*: cx_map_remove_str, \
universe@694 969 char const*: cx_map_remove_str) \
universe@691 970 (map, key)
universe@691 971
universe@691 972 /**
universe@691 973 * Detaches a key/value-pair from the map by using the key
universe@691 974 * without invoking the destructor.
universe@691 975 *
universe@691 976 * @param map the map
universe@691 977 * @param key the key
universe@691 978 */
universe@691 979 __attribute__((__nonnull__))
universe@691 980 static inline void cx_map_detach(
universe@691 981 CxMap *map,
universe@691 982 CxHashKey key
universe@691 983 ) {
universe@691 984 (void) map->cl->remove(map, key, false);
universe@691 985 }
universe@691 986
universe@691 987 /**
universe@691 988 * Detaches a key/value-pair from the map by using the key
universe@691 989 * without invoking the destructor.
universe@691 990 *
universe@691 991 * @param map the map
universe@691 992 * @param key the key
universe@691 993 */
universe@691 994 __attribute__((__nonnull__))
universe@691 995 static inline void cx_map_detach_cxstr(
universe@691 996 CxMap *map,
universe@691 997 cxstring key
universe@691 998 ) {
universe@691 999 (void) map->cl->remove(map, cx_hash_key_cxstr(key), false);
universe@691 1000 }
universe@691 1001
universe@691 1002 /**
universe@691 1003 * Detaches a key/value-pair from the map by using the key
universe@691 1004 * without invoking the destructor.
universe@691 1005 *
universe@691 1006 * @param map the map
universe@691 1007 * @param key the key
universe@691 1008 */
universe@691 1009 __attribute__((__nonnull__))
universe@692 1010 static inline void cx_map_detach_mustr(
universe@692 1011 CxMap *map,
universe@692 1012 cxmutstr key
universe@692 1013 ) {
universe@692 1014 (void) map->cl->remove(map, cx_hash_key_cxstr(key), false);
universe@692 1015 }
universe@692 1016
universe@692 1017 /**
universe@692 1018 * Detaches a key/value-pair from the map by using the key
universe@692 1019 * without invoking the destructor.
universe@692 1020 *
universe@692 1021 * @param map the map
universe@692 1022 * @param key the key
universe@692 1023 */
universe@692 1024 __attribute__((__nonnull__))
universe@691 1025 static inline void cx_map_detach_str(
universe@691 1026 CxMap *map,
universe@691 1027 char const *key
universe@691 1028 ) {
universe@691 1029 (void) map->cl->remove(map, cx_hash_key_str(key), false);
universe@691 1030 }
universe@691 1031
universe@691 1032 /**
universe@691 1033 * Detaches a key/value-pair from the map by using the key
universe@691 1034 * without invoking the destructor.
universe@691 1035 *
universe@691 1036 * In general, you should only use this function if the map does not own
universe@691 1037 * the data and there is a valid reference to the data somewhere else
universe@691 1038 * in the program. In all other cases it is preferable to use
universe@691 1039 * cxMapRemove() or cxMapRemoveAndGet().
universe@691 1040 *
universe@691 1041 * @param map the map
universe@691 1042 * @param key the key
universe@691 1043 * @see cxMapRemove()
universe@691 1044 * @see cxMapRemoveAndGet()
universe@691 1045 */
universe@691 1046 #define cxMapDetach(map, key) _Generic((key), \
universe@691 1047 CxHashKey: cx_map_detach, \
universe@691 1048 cxstring: cx_map_detach_cxstr, \
universe@692 1049 cxmutstr: cx_map_detach_mustr, \
universe@694 1050 char*: cx_map_detach_str, \
universe@694 1051 char const*: cx_map_detach_str) \
universe@691 1052 (map, key)
universe@691 1053
universe@691 1054 /**
universe@691 1055 * Removes a key/value-pair from the map by using the key.
universe@691 1056 *
universe@691 1057 * @param map the map
universe@691 1058 * @param key the key
universe@691 1059 * @return the stored pointer or \c NULL if either the key is not present
universe@691 1060 * in the map or the map is not storing pointers
universe@691 1061 */
universe@691 1062 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 1063 static inline void *cx_map_remove_and_get(
universe@691 1064 CxMap *map,
universe@691 1065 CxHashKey key
universe@691 1066 ) {
universe@691 1067 return map->cl->remove(map, key, !map->store_pointer);
universe@691 1068 }
universe@691 1069
universe@691 1070 /**
universe@691 1071 * Removes a key/value-pair from the map by using the key.
universe@691 1072 *
universe@691 1073 * @param map the map
universe@691 1074 * @param key the key
universe@691 1075 * @return the stored pointer or \c NULL if either the key is not present
universe@691 1076 * in the map or the map is not storing pointers
universe@691 1077 */
universe@691 1078 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 1079 static inline void *cx_map_remove_and_get_cxstr(
universe@691 1080 CxMap *map,
universe@691 1081 cxstring key
universe@691 1082 ) {
universe@691 1083 return map->cl->remove(map, cx_hash_key_cxstr(key), !map->store_pointer);
universe@691 1084 }
universe@691 1085
universe@691 1086 /**
universe@691 1087 * Removes a key/value-pair from the map by using the key.
universe@691 1088 *
universe@691 1089 * @param map the map
universe@691 1090 * @param key the key
universe@691 1091 * @return the stored pointer or \c NULL if either the key is not present
universe@691 1092 * in the map or the map is not storing pointers
universe@691 1093 */
universe@691 1094 __attribute__((__nonnull__, __warn_unused_result__))
universe@692 1095 static inline void *cx_map_remove_and_get_mustr(
universe@692 1096 CxMap *map,
universe@692 1097 cxmutstr key
universe@692 1098 ) {
universe@692 1099 return map->cl->remove(map, cx_hash_key_cxstr(key), !map->store_pointer);
universe@692 1100 }
universe@692 1101
universe@692 1102 /**
universe@692 1103 * Removes a key/value-pair from the map by using the key.
universe@692 1104 *
universe@692 1105 * @param map the map
universe@692 1106 * @param key the key
universe@692 1107 * @return the stored pointer or \c NULL if either the key is not present
universe@692 1108 * in the map or the map is not storing pointers
universe@692 1109 */
universe@692 1110 __attribute__((__nonnull__, __warn_unused_result__))
universe@691 1111 static inline void *cx_map_remove_and_get_str(
universe@691 1112 CxMap *map,
universe@691 1113 char const *key
universe@691 1114 ) {
universe@691 1115 return map->cl->remove(map, cx_hash_key_str(key), !map->store_pointer);
universe@691 1116 }
universe@691 1117
universe@691 1118 /**
universe@691 1119 * Removes a key/value-pair from the map by using the key.
universe@691 1120 *
universe@691 1121 * This function can be used when the map is storing pointers,
universe@691 1122 * in order to retrieve the pointer from the map without invoking
universe@691 1123 * any destructor function. Sometimes you do not want the pointer
universe@691 1124 * to be returned - in that case (instead of suppressing the "unused
universe@691 1125 * result" warning) you can use cxMapDetach().
universe@691 1126 *
universe@691 1127 * If this map is not storing pointers, this function behaves like
universe@691 1128 * cxMapRemove() and returns \c NULL.
universe@691 1129 *
universe@691 1130 * @param map the map
universe@691 1131 * @param key the key
universe@691 1132 * @return the stored pointer or \c NULL if either the key is not present
universe@691 1133 * in the map or the map is not storing pointers
universe@691 1134 * @see cxMapStorePointers()
universe@691 1135 * @see cxMapDetach()
universe@691 1136 */
universe@691 1137 #define cxMapRemoveAndGet(map, key) _Generic((key), \
universe@691 1138 CxHashKey: cx_map_remove_and_get, \
universe@691 1139 cxstring: cx_map_remove_and_get_cxstr, \
universe@692 1140 cxmutstr: cx_map_remove_and_get_mustr, \
universe@694 1141 char*: cx_map_remove_and_get_str, \
universe@694 1142 char const*: cx_map_remove_and_get_str) \
universe@691 1143 (map, key)
universe@691 1144
universe@691 1145 #endif // __cplusplus
universe@691 1146
universe@691 1147 #endif // UCX_MAP_H

mercurial