ForEach.h File Reference#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);) |
|