SimGrid
|
Functions | |
void | gras_cbps_v_pop (gras_cbps_t ps, const char *name, gras_datadesc_type_t *ddt, void **res) |
Retrieve an element from the PS, and remove it from the PS. | |
void | gras_cbps_v_push (gras_cbps_t ps, const char *name, void *data, gras_datadesc_type_t ddt) |
Declare a new element in the PS, and give it a value. | |
void | gras_cbps_v_set (gras_cbps_t ps, const char *name, void *data, gras_datadesc_type_t ddt) |
Change the value of an element in the PS. | |
void * | gras_cbps_v_get (gras_cbps_t ps, const char *name, gras_datadesc_type_t *ddt) |
Get the value of an element in the PS without modifying it. | |
void | gras_cbps_block_begin (gras_cbps_t ps) |
Begins a new block. | |
void | gras_cbps_block_end (gras_cbps_t ps) |
End the current block, and go back to the upper one. |
Sometimes, one of the callbacks need to leave information for the next ones. If the simple push/pop mechanism introduced in previous section isn't enough, you can always use this full featured one. The bad point is that it is quite badly documented...
void gras_cbps_v_pop | ( | gras_cbps_t | ps, |
const char * | name, | ||
gras_datadesc_type_t * | ddt, | ||
void ** | res | ||
) |
Retrieve an element from the PS, and remove it from the PS.
If it's not present in the current block, it will fail (throwing not_found) and not search in upper blocks since this denotes a programmation error.
void gras_cbps_v_push | ( | gras_cbps_t | ps, |
const char * | name, | ||
void * | data, | ||
gras_datadesc_type_t | ddt | ||
) |
Declare a new element in the PS, and give it a value.
If an element of that name already exists, it is masked by the one given here, and will be seeable again only after a pop to remove the value this push adds.
void gras_cbps_v_set | ( | gras_cbps_t | ps, |
const char * | name, | ||
void * | data, | ||
gras_datadesc_type_t | ddt | ||
) |
Change the value of an element in the PS.
If it's not present in the current block, look in the upper ones. If it's not present in any of them, modify in the globals If not present there neither, the code may segfault (Oli?).
Once a reference to an element of that name is found somewhere in the PS, its value is changed.
void* gras_cbps_v_get | ( | gras_cbps_t | ps, |
const char * | name, | ||
gras_datadesc_type_t * | ddt | ||
) |
Get the value of an element in the PS without modifying it.
(note that you get the content of the data struct and not a copy to it) If it's not present in the current block, look in the upper ones. If it's not present in any of them, look in the globals If not present there neither, the code may segfault (Oli?).
void gras_cbps_block_begin | ( | gras_cbps_t | ps | ) |
Begins a new block.
Blocks are usefull to remove a whole set of declarations you don't even know
E.g., they constitute an elegent solution to recursive data structures.
push/pop may be used in some cases for that, but if your recursive data struct contains other structs needing themselves callbacks, you have to use block_{begin,end} to do the trick.
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
![]() |