list.h File Reference

linked list. More...

#include <iostream>
#include "abacus/abacusroot.h"
#include "abacus/global.h"
#include "abacus/listitem.h"
#include "abacus/list.inc"

Go to the source code of this file.

Classes

class  ABA_LIST< Type >
 class ABA_LIST More...

Defines

#define forAllListElem(L, item, e)
 ABA_LIST: iterators.


Detailed Description

linked list.

Author:
Matthias Elf
The following sections implement a template for a linked linear list. Two classes are required for the representation of this data structure. The first one ABA_LISTITEM forms the basic building block of the list storing an element and a pointer to the next item of the list, the second one is the ABA_LIST itself.

License:
This file is part of ABACUS - A Branch And CUt System Copyright (C) 1995 - 2003 University of Cologne, Germany
This library 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 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
See also:
http://www.gnu.org/copyleft/gpl.html

Definition in file list.h.


Define Documentation

#define forAllListElem ( L,
item,
 ) 

Value:

for((item = (L).first()) ? (e = (item)->elem()) : 0; item !=0; \
    (item = (item)->succ()) ? (e = (item)->elem()) : 0)
ABA_LIST: iterators.

The iterator forAllListElem assigns to Type e all elements in the list beginning with the first element. Deletions of elements in the list during the application of this iterator can cause an error. The operator ?: is used that item is only dereferenced if item != 0. The expression 0 on the right side of : is only a dummy that this expression is compilable.

Parameters:
L The list that should be iterated (ABA_LIST<Type>).
item An auxilliary pointer to a list item (ABA_LISTITEM<Type> *).
e The elements in the list are assigned to this variable (Type).

Definition at line 186 of file list.h.


Generated on Tue Aug 14 18:09:55 2007 for ABACUS by  doxygen 1.5.1