Applied java data array encoding patch from Colin Fleming. Only works with byte
[ragel.git] / aapl / avliset.h
blobcf5be365ee5a63b6e1b24720f747a1e796f470cf
1 /*
2 * Copyright 2002 Adrian Thurston <thurston@cs.queensu.ca>
3 */
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)
10 * any later version.
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.
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_AVLISET_H
23 #define _AAPL_AVLISET_H
25 #include "compare.h"
26 #include "dlist.h"
28 /**
29 * \addtogroup avlitree
30 * @{
33 /**
34 * \class AvliSet
35 * \brief Linked Key-only oriented tree.
37 * AvliSet stores only keys in elements that are managed by the tree. AvliSet
38 * requires that a Key type and a class containing a compare() routine
39 * for Key be given. Items are inserted with just a key value.
41 * AvliSet assumes all elements in the tree are allocated on the heap and are
42 * to be managed by the tree. This means that the class destructor will delete
43 * the contents of the tree. A deep copy will cause existing elements to be
44 * deleted first.
46 * \include ex_avliset.cpp
49 /*@}*/
51 #define AVLTREE_SET
52 #define BASE_EL(name) name
53 #define BASEKEY(name) name
54 #define BASELIST DList< AvliSetEl<Key> >
55 #define AVLMEL_CLASSDEF class Key, class Compare = CmpOrd<Key>
56 #define AVLMEL_TEMPDEF class Key, class Compare
57 #define AVLMEL_TEMPUSE Key, Compare
58 #define AvlTree AvliSet
59 #define Element AvliSetEl<Key>
60 #define WALKABLE
62 #include "avlcommon.h"
64 #undef AVLTREE_SET
65 #undef BASE_EL
66 #undef BASEKEY
67 #undef BASELIST
68 #undef AVLMEL_CLASSDEF
69 #undef AVLMEL_TEMPDEF
70 #undef AVLMEL_TEMPUSE
71 #undef AvlTree
72 #undef Element
73 #undef WALKABLE
75 #endif /* _AAPL_AVLISET_H */