Cursors are used to iterate over the structure.
Never add elements to the DynArr during the traversal. To remove elements, use the xbt_dynar_cursor_rm() function.
Do not call these function directly, but only within the xbt_dynar_foreach macro.
§ xbt_dynar_foreach
#define xbt_dynar_foreach |
( |
|
_dynar, |
|
|
|
_cursor, |
|
|
|
_data |
|
) |
| |
§ xbt_dynar_foreach_ptr
#define xbt_dynar_foreach_ptr |
( |
|
_dynar, |
|
|
|
_cursor, |
|
|
|
_ptr |
|
) |
| |
Value:for ((_cursor) = 0 ; \
(_cursor)++ )
void * xbt_dynar_get_ptr(const xbt_dynar_t dynar, const unsigned long idx)
Retrieve a pointer to the Nth element of a dynar.
Definition: dynar.cpp:238
§ s_xbt_dynar_t
§ xbt_dynar_cursor_rm()
Removes and free the entry pointed by the cursor.
This function can be used while traversing without problem.
§ _xbt_dynar_cursor_get()
static int _xbt_dynar_cursor_get |
( |
const xbt_dynar_t |
dynar, |
|
|
unsigned int |
idx, |
|
|
void *const |
dst |
|
) |
| |
|
inlinestatic |