OpenGraph DrawingFramework

v.2012.07

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::List< E >
The parameterized class ListPure<E> represents doubly linked lists with content type E. More...
class  ogdf::ListConstIterator< E >
The parameterized class ListIterator<E> encapsulates a constant pointer to a list element. More...
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::ListPure< E >
The parameterized class ListPure<E> represents doubly linked lists with content type E. More...

Namespaces

namespace  ogdf
The namespace for all OGDF objects.

Macros

#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_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_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>.
#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_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 OGDF_LIST_H

Functions

template<class E >
ostream & ogdf::operator<< (ostream &os, const ListPure< E > &L)
template<class E >
ostream & ogdf::operator<< (ostream &os, const List< E > &L)
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= ' ')

Detailed Description

Declaration of doubly linked lists and iterators.

This file is part of the Open Graph Drawing Framework (OGDF).
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; see the file LICENSE.txt included in the packaging of this file for details.
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.
http://www.gnu.org/copyleft/gpl.html

Definition in file List.h.

Macro Definition 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 1089 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 1105 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 1129 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 1097 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 1113 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 1121 of file List.h.

 #define OGDF_LIST_H

Definition at line 48 of file List.h.