SimGrid  3.19.1
Versatile Simulation of Distributed Systems
dict.h File Reference
#include <xbt/dynar.h>
#include <xbt/misc.h>
#include <stdint.h>

Classes

struct  s_xbt_dictelm
 
struct  s_xbt_dict_cursor
 

Macros

#define xbt_dict_foreach(dict, cursor, key, data)
 

Typedefs

typedef struct s_xbt_dictxbt_dict_t
 Dictionary data type (opaque structure) More...
 
typedef struct s_xbt_dictelmxbt_dictelm_t
 
typedef struct s_xbt_dictelm s_xbt_dictelm_t
 
typedef struct s_xbt_dict_cursorxbt_dict_cursor_t
 Cursor on dictionaries (opaque type) More...
 

Functions

xbt_dict_t xbt_dict_new_homogeneous (void_f_pvoid_t free_ctn)
 Constructor. More...
 
void xbt_dict_free (xbt_dict_t *dict)
 Destructor. More...
 
unsigned int xbt_dict_size (xbt_dict_t dict)
 Returns the amount of elements in the dict. More...
 
void xbt_dict_set (xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t free_ctn)
 Add data to the dict (null-terminated key) More...
 
voidxbt_dict_get (xbt_dict_t dict, const char *key)
 Retrieve data from the dict (null-terminated key) More...
 
voidxbt_dict_get_or_null (xbt_dict_t dict, const char *key)
 like xbt_dict_get(), but returning nullptr when not found More...
 
char * xbt_dict_get_key (xbt_dict_t dict, const void *data)
 retrieve the key associated to that object. More...
 
 XBT_ATTRIB_DEPRECATED_v321 ("xbt_dict is dying. v3.21 will turn this warning into an error.") char *xbt_dict_get_elm_key(xbt_dictelm_t elem)
 
xbt_dictelm_t xbt_dict_get_elm (xbt_dict_t dict, const char *key)
 Retrieve element from the dict (null-terminated key) More...
 
xbt_dictelm_t xbt_dict_get_elm_or_null (xbt_dict_t dict, const char *key)
 like xbt_dict_get_elm(), but returning nullptr when not found More...
 
void xbt_dict_remove (xbt_dict_t dict, const char *key)
 Remove data from the dict (null-terminated key) More...
 
void xbt_dict_reset (xbt_dict_t dict)
 Remove all data from the dict. More...
 
int xbt_dict_length (xbt_dict_t dict)
 Return the number of elements in the dict. More...
 
void xbt_dict_dump (xbt_dict_t dict, void(*output)(void *))
 Outputs the content of the structure (debugging purpose) More...
 
int xbt_dict_is_empty (xbt_dict_t dict)
 test if the dict is empty or not More...
 
void xbt_dict_set_ext (xbt_dict_t dict, const char *key, int key_len, void *data, void_f_pvoid_t free_ctn)
 
voidxbt_dict_get_ext (xbt_dict_t dict, const char *key, int key_len)
 Retrieve data from the dict (arbitrary key) More...
 
voidxbt_dict_get_or_null_ext (xbt_dict_t dict, const char *key, int key_len)
 like xbt_dict_get_ext(), but returning nullptr when not found More...
 
void xbt_dict_remove_ext (xbt_dict_t dict, const char *key, int key_len)
 Remove data from the dict (arbitrary key) More...
 
static xbt_dictelm_t xbt_dict_cursor_get_elm (xbt_dict_cursor_t cursor)
 
xbt_dict_cursor_t xbt_dict_cursor_new (const xbt_dict_t dict)
 Creator. More...
 
void xbt_dict_cursor_free (xbt_dict_cursor_t *cursor)
 Destructor. More...
 
void xbt_dict_cursor_rewind (xbt_dict_cursor_t cursor)
 Reinitialize the cursor. More...
 
char * xbt_dict_cursor_get_key (xbt_dict_cursor_t cursor)
 Get current key. More...
 
voidxbt_dict_cursor_get_data (xbt_dict_cursor_t cursor)
 Get current data. More...
 
void xbt_dict_cursor_first (const xbt_dict_t dict, xbt_dict_cursor_t *cursor)
 Create the cursor if it does not exists. More...
 
void xbt_dict_cursor_step (xbt_dict_cursor_t cursor)
 Move to the next element. More...
 
int xbt_dict_cursor_get_or_free (xbt_dict_cursor_t *cursor, char **key, void **data)
 Get current data, or free the cursor if there is no data left. More...
 

Variables

voiddata
 
void void_f_pvoid_t free_ctn