SimGrid  3.13
Versatile Simulation of Distributed Systems

Iterates over the whole swag. More...

Macros

#define xbt_swag_foreach(obj, swag)
 A simple swag iterator. More...
 
#define xbt_swag_foreach_safe(obj, obj_next, swag)
 A safe swag iterator. More...
 

Detailed Description

Iterates over the whole swag.

Macro Definition Documentation

#define xbt_swag_foreach (   obj,
  swag 
)

A simple swag iterator.

Parameters
objthe indice of the loop
swagwhat to iterate over
Warning
you cannot modify the swag while using this loop
#define xbt_swag_foreach_safe (   obj,
  obj_next,
  swag 
)

A safe swag iterator.

Parameters
objthe indice of the loop
obj_nextthe object that is right after (if any) obj in the swag
swagwhat to iterate over

You can safely modify the swag while using this loop. Well, safely... Err. You can remove obj without having any trouble at least.