Initialize Tizen 2.3
[external/ragel.git] / aapl / dlistval.h
1 /*
2  *  Copyright 2002 Adrian Thurston <thurston@complang.org>
3  */
4
5 /*  This file is part of Aapl.
6  *
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)
10  *  any later version.
11  *
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
15  *  more details.
16  *
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
20  */
21
22 #ifndef _AAPL_DLISTVAL_H
23 #define _AAPL_DLISTVAL_H
24
25 /**
26  * \addtogroup dlist
27  * @{
28  */
29
30 /**
31  * \class DListVal
32  * \brief By-value doubly linked list.
33  *
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.
39  *
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
47  * allocated elements.
48  *
49  * \include ex_dlistval.cpp
50  */
51
52 /*@}*/
53
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
60
61 #include "dlcommon.h"
62
63 #undef BASE_EL
64 #undef DLMEL_TEMPDEF
65 #undef DLMEL_TEMPUSE
66 #undef DList
67 #undef Element
68 #undef DOUBLELIST_VALUE
69
70 #endif /* _AAPL_DLISTVAL_H */
71