summaryrefslogtreecommitdiff
path: root/aapl/dlist.h
blob: eaf3e5d5f5025107f4404c6a769cd284f90f93d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 *  Copyright 2001 Adrian Thurston <thurston@cs.queensu.ca>
 */

/*  This file is part of Aapl.
 *
 *  Aapl 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.
 *
 *  Aapl 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 Aapl; if not, write to the Free Software Foundation, Inc., 59
 *  Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef _AAPL_DLIST_H
#define _AAPL_DLIST_H

#define BASE_EL(name) name
#define DLMEL_TEMPDEF class Element
#define DLMEL_TEMPUSE Element
#define DList DList

/**
 * \addtogroup dlist
 * @{
 */

/**
 * \class DList
 * \brief Basic doubly linked list.
 *
 * DList is the standard by-structure list type. This class requires the
 * programmer to declare a list element type that has the necessary next and
 * previous pointers in it. This can be achieved by inheriting from the
 * DListEl class or by simply adding next and previous pointers directly into
 * the list element class.
 *
 * DList does not assume ownership of elements in the list. If the elements
 * are known to reside on the heap, the provided empty() routine can be used to
 * delete all elements, however the destructor will not call this routine, it
 * will simply abandon all the elements. It is up to the programmer to
 * explicitly de-allocate items when necessary.
 *
 * \include ex_dlist.cpp
 */

/*@}*/

#include "dlcommon.h"

#undef BASE_EL
#undef DLMEL_TEMPDEF
#undef DLMEL_TEMPUSE
#undef DList

#endif /* _AAPL_DLIST_H */