---
name: "ForEach.h"
section: "3tulip"
platform: "linux"
package: "tulip-doc"
version: "3.1.2-2.3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ForEach.h"
---

# ForEach.h(3tulip)

## NAME

ForEach.h -

## SYNOPSIS

`#include <assert.h>`\
 `#include <tulip/Iterator.h>`\
 `#include <tulip/StableIterator.h>`\

### Defines

\#define **forEach**(A, B)   for(void \*\_it\_foreach = tlp::\_tlp\_get\_it(A, B); tlp::\_tlp\_if\_test(A, \_it\_foreach);)\
 \#define **stableForEach**(A, B)   for(void \*\_it\_foreach = tlp::\_tlp\_get\_stable\_it(A, B); tlp::\_tlp\_if\_test(A, \_it\_foreach);)\
 \#define **\_delete\_it\_foreach**   ((\*\*((void (\*\*) (void \*)) \_it\_foreach))(\_it\_foreach))\
 \#define **breakForEach**   {\_delete\_it\_foreach; break;}\
 \#define **returnForEach**(VAL)   {\_delete\_it\_foreach; return VAL;}\

## Define Documentation

### #define \_delete\_it\_foreach ((\*\*((void (\*\*) (void \*)) \_it\_foreach))(\_it\_foreach))

### #define breakForEach {\_delete\_it\_foreach; break;}

### #define forEach(A, B) for(void \*\_it\_foreach = tlp::\_tlp\_get\_it(A, B); tlp::\_tlp\_if\_test(A, \_it\_foreach);) Authors: David Auber, Patrick Mary, Morgan Mathiaut from the LaBRI Visualization Team Email : auber@tulip-software.org Last modification : 13/03/2009 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Warning, do not use break or return inside a for each block; it causes a memory leak; use breakForEach pr returnForEachInstead

### #define returnForEach(VAL) {\_delete\_it\_foreach; return VAL;}

### #define stableForEach(A, B) for(void \*\_it\_foreach = tlp::\_tlp\_get\_stable\_it(A, B); tlp::\_tlp\_if\_test(A, \_it\_foreach);)

## Author

Generated automatically by Doxygen for Tulip Graph Library from the source code.
