src/cx/iterator.h

changeset 1426
3a89b31f0724
parent 1424
563033aa998c
child 1429
6e0c3a8a914a
equal deleted inserted replaced
1425:83284b289430 1426:3a89b31f0724
227 * @param elem_count the number of elements in the array 227 * @param elem_count the number of elements in the array
228 * @return an iterator for the specified array 228 * @return an iterator for the specified array
229 * @see cxIteratorPtr() 229 * @see cxIteratorPtr()
230 */ 230 */
231 cx_attr_nodiscard 231 cx_attr_nodiscard
232 cx_attr_export 232 CX_EXPORT CxIterator cxIterator(const void *array,
233 CxIterator cxIterator( 233 size_t elem_size, size_t elem_count);
234 const void *array,
235 size_t elem_size,
236 size_t elem_count
237 );
238 234
239 /** 235 /**
240 * Creates a mutating iterator for the specified plain array. 236 * Creates a mutating iterator for the specified plain array.
241 * 237 *
242 * While the iterator is in use, the array may only be altered by removing 238 * While the iterator is in use, the array may only be altered by removing
258 * @param remove_keeps_order @c true if the order of elements must be preserved 254 * @param remove_keeps_order @c true if the order of elements must be preserved
259 * when removing an element 255 * when removing an element
260 * @return an iterator for the specified array 256 * @return an iterator for the specified array
261 */ 257 */
262 cx_attr_nodiscard 258 cx_attr_nodiscard
263 cx_attr_export 259 CX_EXPORT CxIterator cxMutIterator(void *array,
264 CxIterator cxMutIterator( 260 size_t elem_size, size_t elem_count, bool remove_keeps_order);
265 void *array,
266 size_t elem_size,
267 size_t elem_count,
268 bool remove_keeps_order
269 );
270 261
271 /** 262 /**
272 * Creates an iterator for the specified plain pointer array. 263 * Creates an iterator for the specified plain pointer array.
273 * 264 *
274 * This iterator assumes that every element in the array is a pointer 265 * This iterator assumes that every element in the array is a pointer
280 * @param elem_count the number of elements in the array 271 * @param elem_count the number of elements in the array
281 * @return an iterator for the specified array 272 * @return an iterator for the specified array
282 * @see cxIterator() 273 * @see cxIterator()
283 */ 274 */
284 cx_attr_nodiscard 275 cx_attr_nodiscard
285 cx_attr_export 276 CX_EXPORT CxIterator cxIteratorPtr(const void *array, size_t elem_count);
286 CxIterator cxIteratorPtr(
287 const void *array,
288 size_t elem_count
289 );
290 277
291 /** 278 /**
292 * Creates a mutating iterator for the specified plain pointer array. 279 * Creates a mutating iterator for the specified plain pointer array.
293 * 280 *
294 * This is the mutating variant of cxIteratorPtr(). See also 281 * This is the mutating variant of cxIteratorPtr(). See also
301 * @return an iterator for the specified array 288 * @return an iterator for the specified array
302 * @see cxMutIterator() 289 * @see cxMutIterator()
303 * @see cxIteratorPtr() 290 * @see cxIteratorPtr()
304 */ 291 */
305 cx_attr_nodiscard 292 cx_attr_nodiscard
306 cx_attr_export 293 CX_EXPORT CxIterator cxMutIteratorPtr(void *array,
307 CxIterator cxMutIteratorPtr( 294 size_t elem_count, bool remove_keeps_order);
308 void *array,
309 size_t elem_count,
310 bool remove_keeps_order
311 );
312 295
313 #ifdef __cplusplus 296 #ifdef __cplusplus
314 } // extern "C" 297 } // extern "C"
315 #endif 298 #endif
316 299

mercurial