Overview     Modules     Class Hierarchy     Classes     Members  
ForEach.h File Reference
#include <cassert>
#include <tulip/Iterator.h>
#include <tulip/StableIterator.h>
#include <tulip/tulipconf.h>
Include dependency graph for ForEach.h:
This graph shows which files directly or indirectly include this file:

Defines

  • #define forEach(A, B)   for(tlp::_TLP_IT<TYPEOF(A) > _it_foreach(B); tlp::_tlp_if_test(A, _it_foreach);)
    Allows to iterate on the nodes or edges of a Graph in a clear and concise way. It also avoid having to manage a tulip Iterator, whose deletion is often forgotten.
  • #define stableForEach(A, B)   for(tlp::_TLP_IT<TYPEOF(A) > _it_foreach(new tlp::StableIterator<TYPEOF(A) >(B)); tlp::_tlp_if_test(A, _it_foreach);)
    Allows to iterate on the nodes or edges of a copy of a Graph in a clear and concise way. The stable Iterator creates a copy of the Graph, and iterates on the said copy. It allows deletion operations to be performed without invalidating the iterator. It also avoid having to manage a tulip Iterator, whose deletion is often forgotten.
  • #define breakForEach   {break;}
  • #define returnForEach(VAL)   {return VAL;}

Define Documentation

#define breakForEach   {break;}
#define forEach (   A,
 
)    for(tlp::_TLP_IT<TYPEOF(A) > _it_foreach(B); tlp::_tlp_if_test(A, _it_foreach);)

Allows to iterate on the nodes or edges of a Graph in a clear and concise way. It also avoid having to manage a tulip Iterator, whose deletion is often forgotten.

This file is part of Tulip (www.tulip-software.org)

Authors: David Auber and the Tulip development Team from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest

Tulip is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Tulip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

#define returnForEach (   VAL)    {return VAL;}
#define stableForEach (   A,
 
)    for(tlp::_TLP_IT<TYPEOF(A) > _it_foreach(new tlp::StableIterator<TYPEOF(A) >(B)); tlp::_tlp_if_test(A, _it_foreach);)

Allows to iterate on the nodes or edges of a copy of a Graph in a clear and concise way. The stable Iterator creates a copy of the Graph, and iterates on the said copy. It allows deletion operations to be performed without invalidating the iterator. It also avoid having to manage a tulip Iterator, whose deletion is often forgotten.



Tulip Software by LaBRI Visualization Team    2001 - 2012