Open
Graph Drawing
Framework

 v.2010.10
 

Classes | Namespaces | Defines | Functions

List.h File Reference

Declaration of doubly linked lists and iterators. More...

#include <ogdf/internal/basic/list_templates.h>

Go to the source code of this file.

Classes

class  ogdf::ListElement< E >
 The parameterized class ListElement<E> represents the structure for elements of doubly linked lists. More...
class  ogdf::ListIterator< E >
 The parameterized class ListIterator<E> encapsulates a pointer to a dlist element. More...
class  ogdf::ListConstIterator< E >
 The parameterized class ListIterator<E> encapsulates a constant pointer to a list element. More...
class  ogdf::ListPure< E >
 The parameterized class ListPure<E> represents doubly linked lists with content type E. More...
class  ogdf::List< E >
 The parameterized class ListPure<E> represents doubly linked lists with content type E. More...

Namespaces

namespace  ogdf
 

The namespace for all OGDF objects.


Defines

#define forall_listiterators(type, it, L)   for(ListConstIterator< type > it = (L).begin(); it.valid(); ++it)
 Iteration over all iterators it of a list L, where L is of Type List<type>.
#define forall_rev_listiterators(type, it, L)   for(ListConstIterator< type > it = (L).rbegin(); it.valid(); --it)
 Iteration over all iterators it of a list L, where L is of Type List<type>, in reverse order.
#define forall_nonconst_listiterators(type, it, L)   for(ListIterator< type > it = (L).begin(); it.valid(); ++it)
 Iteration over all non-const iterators it of a list L, where L is of Type List<type>.
#define forall_rev_nonconst_listiterators(type, it, L)   for(ListIterator< type > it = (L).rbegin(); it.valid(); --it)
 Iteration over all non-const iterators it of a list L, where L is of Type List<type>, in reverse order.
#define forall_slistiterators(type, it, L)   for(SListConstIterator< type > it = (L).begin(); it.valid(); ++it)
 Iteration over all iterators it of a list L, where L is of Type SList<type>.
#define forall_nonconst_slistiterators(type, it, L)   for(SListIterator< type > it = (L).begin(); it.valid(); ++it)
 Iteration over all non-const iterators it of a list L, where L is of Type SList<type>.

Functions

template<class E >
void ogdf::print (ostream &os, const ListPure< E > &L, char delim= ' ')
template<class E >
void ogdf::print (ostream &os, const List< E > &L, char delim= ' ')
template<class E >
ostream & ogdf::operator<< (ostream &os, const ListPure< E > &L)
template<class E >
ostream & ogdf::operator<< (ostream &os, const List< E > &L)

Detailed Description

Declaration of doubly linked lists and iterators.

Author:
Carsten Gutwenger and Sebastian Leipert
License:
This file is part of the Open Graph Drawing Framework (OGDF).

Copyright (C). All rights reserved. See README.txt in the root directory of the OGDF installation for details.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 or 3 as published by the Free Software Foundation and appearing in the files LICENSE_GPL_v2.txt and LICENSE_GPL_v3.txt included in the packaging of this file.
In addition, as a special exception, you have permission to link this software with the libraries of the COIN-OR Osi project (http://www.coin-or.org/projects/Osi.xml), all libraries required by Osi, and all LP-solver libraries directly supported by the COIN-OR Osi project, and distribute executables, as long as you follow the requirements of the GNU General Public License in regard to all of the software in the executable aside from these third-party libraries.
This program 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.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See also:
http://www.gnu.org/copyleft/gpl.html

Definition in file List.h.


Define Documentation

#define forall_listiterators (   type,
  it,
  L 
)    for(ListConstIterator< type > it = (L).begin(); it.valid(); ++it)

Iteration over all iterators it of a list L, where L is of Type List<type>.

Automagically creates a ListConstIterator<type> named it, and runs through the List L.

Example

The following code runs through the list L, and prints each item

   List<double> L;
   ...
   forall_listiterators(double, it, L) {
     cout << *it << endl;
   }

Note that this code is equivalent to the following tedious long version

   List<double> L;
   ...
   for( ListConstIterator<double> it = L.begin(); it.valid(); ++it) {
     cout << *it << endl;
   }

Definition at line 1060 of file List.h.

#define forall_nonconst_listiterators (   type,
  it,
  L 
)    for(ListIterator< type > it = (L).begin(); it.valid(); ++it)

Iteration over all non-const iterators it of a list L, where L is of Type List<type>.

Automagically creates a ListIterator<type> named it, and runs through the List L. See forall_listiterators for an example.

Definition at line 1076 of file List.h.

#define forall_nonconst_slistiterators (   type,
  it,
  L 
)    for(SListIterator< type > it = (L).begin(); it.valid(); ++it)

Iteration over all non-const iterators it of a list L, where L is of Type SList<type>.

Automagically creates a SListIterator<type> named it, and runs through the SList L. See forall_listiterators for an example.

Definition at line 1100 of file List.h.

#define forall_rev_listiterators (   type,
  it,
  L 
)    for(ListConstIterator< type > it = (L).rbegin(); it.valid(); --it)

Iteration over all iterators it of a list L, where L is of Type List<type>, in reverse order.

Automagically creates a ListConstIterator<type> named it, and runs through the List L, in reverse order. See forall_listiterators for an example.

Definition at line 1068 of file List.h.

#define forall_rev_nonconst_listiterators (   type,
  it,
  L 
)    for(ListIterator< type > it = (L).rbegin(); it.valid(); --it)

Iteration over all non-const iterators it of a list L, where L is of Type List<type>, in reverse order.

Automagically creates a ListIterator<type> named it, and runs through the List L, in reverse order. See forall_listiterators for an example.

Definition at line 1084 of file List.h.

#define forall_slistiterators (   type,
  it,
  L 
)    for(SListConstIterator< type > it = (L).begin(); it.valid(); ++it)

Iteration over all iterators it of a list L, where L is of Type SList<type>.

Automagically creates a SListConstIterator<type> named it, and runs through the SList L. See forall_listiterators for an example.

Definition at line 1092 of file List.h.