2 * Copyright 2002 Adrian Thurston <thurston@complang.org>
5 /* This file is part of Aapl.
7 * Aapl is free software; you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 2.1 of the License, or (at your option)
12 * Aapl is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with Aapl; if not, write to the Free Software Foundation, Inc., 59
19 * Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef _AAPL_DLISTVAL_H
23 #define _AAPL_DLISTVAL_H
32 * \brief By-value doubly linked list.
34 * This class is a doubly linked list that does not require a list element
35 * type to be declared. The user instead gives a type that is to be stored in
36 * the list element. When inserting a new data item, the value is copied into
37 * a newly allocated element. This list is inteded to behave and be utilized
38 * like the list template found in the STL.
40 * DListVal is different from the other lists in that it allocates elements
41 * itself. The raw element insert interface is still exposed for convenience,
42 * however, the list assumes all elements in the list are allocated on the
43 * heap and are to be managed by the list. The destructor WILL delete the
44 * contents of the list. If the list is ever copied in from another list, the
45 * existing contents are deleted first. This is in contrast to DList and
46 * DListMel, which will never delete their contents to allow for statically
49 * \include ex_dlistval.cpp
54 #define BASE_EL(name) name
55 #define DLMEL_TEMPDEF class T
56 #define DLMEL_TEMPUSE T
57 #define DList DListVal
58 #define Element DListValEl<T>
59 #define DOUBLELIST_VALUE
68 #undef DOUBLELIST_VALUE
70 #endif /* _AAPL_DLISTVAL_H */