Initialize Tizen 2.3
[external/ragel.git] / aapl / avlmel.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_AVLMEL_H
23 #define _AAPL_AVLMEL_H
24
25 #include "compare.h"
26
27 /**
28  * \addtogroup avltree 
29  * @{
30  */
31
32 /**
33  * \class AvlMel
34  * \brief AVL tree for elements appearing in multiple trees.
35  *
36  * AvlMel allows for an element to simultaneously be in multiple trees without
37  * the trees interferring with one another. For each tree that the element is
38  * to appear in, there must be a distinct set of AVL Tree management data that
39  * can be unambiguously referenced with some base class name. This name
40  * is passed to the tree as a template parameter and is used in the tree
41  * algorithms.
42  *
43  * The element must use the same key type and value in each tree that it
44  * appears in. If distinct keys are required, the AvlMelKey structure is
45  * available.
46  *
47  * AvlMel does not assume ownership of elements in the tree. The destructor
48  * will not delete the elements. If the user wishes to explicitly deallocate
49  * all the items in the tree the empty() routine is available. 
50  *
51  * \include ex_avlmel.cpp
52  */
53
54 /*@}*/
55
56 #define BASE_EL(name) BaseEl::name
57 #define BASEKEY(name) name
58 #define AVLMEL_CLASSDEF class Element, class Key, \
59                 class BaseEl, class Compare = CmpOrd<Key>
60 #define AVLMEL_TEMPDEF class Element, class Key, \
61                 class BaseEl, class Compare
62 #define AVLMEL_TEMPUSE Element, Key, BaseEl, Compare
63 #define AvlTree AvlMel
64
65 #include "avlcommon.h"
66
67 #undef BASE_EL
68 #undef BASEKEY
69 #undef AVLMEL_CLASSDEF
70 #undef AVLMEL_TEMPDEF
71 #undef AVLMEL_TEMPUSE
72 #undef AvlTree
73
74 #endif /* _AAPL_AVLMEL_H */