/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* @brief DynArr are dynamically sized vector which may contain any type of variables.
*
* These are the SimGrid version of the dynamically size arrays, which all C programmer recode one day or another.
* @brief DynArr are dynamically sized vector which may contain any type of variables.
*
* These are the SimGrid version of the dynamically size arrays, which all C programmer recode one day or another.
* For performance concerns, the content of DynArr must be homogeneous (in contrary to dictionnaries -- see the
* \ref XBT_dict section). You thus have to provide the function which will be used to free the content at
* structure creation (of type void_f_pvoid_t).
* For performance concerns, the content of DynArr must be homogeneous (in contrary to dictionnaries -- see the
* \ref XBT_dict section). You thus have to provide the function which will be used to free the content at
* structure creation (of type void_f_pvoid_t).
* @hideinitializer */
# define xbt_dynar_get_as(dynar,idx,type) \
(*(type*)xbt_dynar_get_ptr((dynar),(idx)))
* @hideinitializer */
# define xbt_dynar_get_as(dynar,idx,type) \
(*(type*)xbt_dynar_get_ptr((dynar),(idx)))
* @hideinitializer */
# define xbt_dynar_set_as(dynar,idx,type,val) \
(*(type*)xbt_dynar_set_at_ptr((dynar),(idx))) = val
* @hideinitializer */
# define xbt_dynar_set_as(dynar,idx,type,val) \
(*(type*)xbt_dynar_set_at_ptr((dynar),(idx))) = val
* @hideinitializer */
# define xbt_dynar_getlast_as(dynar,type) \
(*(type*)xbt_dynar_get_ptr((dynar),xbt_dynar_length(dynar)-1))
* @hideinitializer */
# define xbt_dynar_getlast_as(dynar,type) \
(*(type*)xbt_dynar_get_ptr((dynar),xbt_dynar_length(dynar)-1))
* @hideinitializer */
# define xbt_dynar_getfirst_as(dynar,type) \
(*(type*)xbt_dynar_get_ptr((dynar),0))
* @hideinitializer */
# define xbt_dynar_getfirst_as(dynar,type) \
(*(type*)xbt_dynar_get_ptr((dynar),0))
* @hideinitializer */
# define xbt_dynar_insert_at_as(dynar,idx,type,value) \
*(type*)xbt_dynar_insert_at_ptr(dynar,idx)=value
* @hideinitializer */
# define xbt_dynar_insert_at_as(dynar,idx,type,value) \
*(type*)xbt_dynar_insert_at_ptr(dynar,idx)=value
* @hideinitializer */
# define xbt_dynar_push_as(dynar,type,value) \
*(type*)xbt_dynar_push_ptr(dynar)=value
* @hideinitializer */
# define xbt_dynar_push_as(dynar,type,value) \
*(type*)xbt_dynar_push_ptr(dynar)=value
* \warning DO NOT USE THIS STRUCTURE DIRECTLY! Instead, use the public interface:
* This was made public to allow:
* - the inlining of the foreach elements
* \warning DO NOT USE THIS STRUCTURE DIRECTLY! Instead, use the public interface:
* This was made public to allow:
* - the inlining of the foreach elements
* Note that underneath, that's a simple for loop with no real black magic involved. It's perfectly safe to interrupt
* a foreach with a break or a return statement.
*/
* Note that underneath, that's a simple for loop with no real black magic involved. It's perfectly safe to interrupt
* a foreach with a break or a return statement.
*/