SimGrid
Functions
Multi-level dictionaries
Dict: generic dictionnary

Functions

void xbt_dict_print (void *data)
 To dump multicache, this function dumps a cache.
void xbt_dict_prints (void *data)
 To dump multicache, this one dumps a string.
void xbt_multidict_set (xbt_dict_t mdict, xbt_dynar_t keys, void *data, void(*free_ctn)(void *))
 Insert data under all the keys contained in keys.
void xbt_multidict_set_ext (xbt_dict_t mdict, xbt_dynar_t keys, xbt_dynar_t lens, void *data, void_f_pvoid_t free_ctn)
 Insert data under all the keys contained in keys, providing their sizes in lens.
void * xbt_multidict_get_ext (xbt_dict_t mdict, xbt_dynar_t keys, xbt_dynar_t lens)
 Insert data under all the keys contained in keys, providing their sizes in lens.
void xbt_multidict_remove_ext (xbt_dict_t mdict, xbt_dynar_t keys, xbt_dynar_t lens)
 Remove the entry under all the keys contained in keys, providing their sizes in lens.

Detailed Description

They can be seen as dictionary of multiple keys or as dictionary of dictionary of ... of data. Most of the functions here work the same way than their simple dictionary counterpart.

Note that there is no xbt_multidict_free neither xbt_multi_dict_new functions. Use xbt_dict_free() and xbt_dict_new() instead.


Function Documentation

void xbt_dict_print ( void *  data)

To dump multicache, this function dumps a cache.

 

void xbt_dict_prints ( void *  data)

To dump multicache, this one dumps a string.

 

void xbt_multidict_set ( xbt_dict_t  mdict,
xbt_dynar_t  keys,
void *  data,
void_f_pvoid_t  free_ctn 
)

Insert data under all the keys contained in keys.

  • head: the head of dict
  • keys: dynar of null-terminated strings containing all the keys
  • data: what to store in the structure
  • free_ctn: function to use to free the pushed content on need
void xbt_multidict_set_ext ( xbt_dict_t  mdict,
xbt_dynar_t  keys,
xbt_dynar_t  lens,
void *  data,
void_f_pvoid_t  free_ctn 
)

Insert data under all the keys contained in keys, providing their sizes in lens.

  • mdict: the multi-dict
  • keys: dynar of (char *) containing all the keys
  • lens: length of each element of keys
  • data: what to store in the structure
  • free_ctn: function to use to free the pushed content on need

Dynars are not modified during the operation.

void* xbt_multidict_get_ext ( xbt_dict_t  mdict,
xbt_dynar_t  keys,
xbt_dynar_t  lens 
)

Insert data under all the keys contained in keys, providing their sizes in lens.

  • mdict: the multi-dict
  • keys: dynar of (char *) containing all the keys
  • lens: length of each element of keys
  • data: where to put what was found in structure
  • free_ctn: function to use to free the pushed content on need

Dynars are not modified during the operation.

void xbt_multidict_remove_ext ( xbt_dict_t  mdict,
xbt_dynar_t  keys,
xbt_dynar_t  lens 
)

Remove the entry under all the keys contained in keys, providing their sizes in lens.

  • mdict: the multi-dict
  • keys: dynar of (char *) containing all the keys
  • lens: length of each element of keys
  • data: what to store in the structure
  • free_ctn: function to use to free the pushed content on need

Dynars are not modified during the operation.

Removing a non-existant key is ok.


Back to the main Simgrid Documentation page The version of Simgrid documented here is v3.6.1.
Documentation of other versions can be found in their respective archive files (directory doc/html).
Generated for SimGridAPI by doxygen