67 /** |
67 /** |
68 * Creates a new hash map with the specified number of buckets. |
68 * Creates a new hash map with the specified number of buckets. |
69 * |
69 * |
70 * If \p buckets is zero, an implementation defined default will be used. |
70 * If \p buckets is zero, an implementation defined default will be used. |
71 * |
71 * |
72 * If \p item_size is CX_STORE_POINTERS, the created map will be created as if |
72 * If \p elem_size is CX_STORE_POINTERS, the created map will be created as if |
73 * cxMapStorePointers() was called immediately after creation. |
73 * cxMapStorePointers() was called immediately after creation. |
74 * |
74 * |
75 * @note Iterators provided by this hash map implementation provide the remove operation. |
75 * @note Iterators provided by this hash map implementation provide the remove operation. |
76 * The index value of an iterator is incremented when the iterator advanced without removal. |
76 * The index value of an iterator is incremented when the iterator advanced without removal. |
77 * In other words, when the iterator is finished, \c index==size . |
77 * In other words, when the iterator is finished, \c index==size . |
81 * @param buckets the initial number of buckets in this hash map |
81 * @param buckets the initial number of buckets in this hash map |
82 * @return a pointer to the new hash map |
82 * @return a pointer to the new hash map |
83 */ |
83 */ |
84 __attribute__((__nonnull__, __warn_unused_result__)) |
84 __attribute__((__nonnull__, __warn_unused_result__)) |
85 CxMap *cxHashMapCreate( |
85 CxMap *cxHashMapCreate( |
86 CxAllocator const *allocator, |
86 const CxAllocator *allocator, |
87 size_t itemsize, |
87 size_t itemsize, |
88 size_t buckets |
88 size_t buckets |
89 ); |
89 ); |
90 |
90 |
91 /** |
91 /** |
92 * Creates a new hash map with a default number of buckets. |
92 * Creates a new hash map with a default number of buckets. |
93 * |
93 * |
94 * If \p item_size is CX_STORE_POINTERS, the created map will be created as if |
94 * If \p elem_size is CX_STORE_POINTERS, the created map will be created as if |
95 * cxMapStorePointers() was called immediately after creation. |
95 * cxMapStorePointers() was called immediately after creation. |
96 * |
96 * |
97 * @note Iterators provided by this hash map implementation provide the remove operation. |
97 * @note Iterators provided by this hash map implementation provide the remove operation. |
98 * The index value of an iterator is incremented when the iterator advanced without removal. |
98 * The index value of an iterator is incremented when the iterator advanced without removal. |
99 * In other words, when the iterator is finished, \c index==size . |
99 * In other words, when the iterator is finished, \c index==size . |