]>
git.ipfire.org Git - thirdparty/squid.git/blob - lib/libTrie/TrieNode.h
2 * Copyright (c) 2002,2003 Robert Collins <rbtcollins@hotmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
20 #ifndef LIBTRIE_TRIENODE_H
21 #define LIBTRIE_TRIENODE_H
23 /* This is an internal header for libTrie.
24 * libTrie provides both C and C++
26 * libTrie itself is written in C++.
27 * For C bindings see Trei.h
35 #include <sys/types.h>
38 /* MinGW needs NULL definition */
43 /* TODO: parameterize this to be more generic -
44 * i.e. M-ary internal node sizes etc
47 class TrieCharTransform
;
55 TrieNode(TrieNode
const &);
56 TrieNode
&operator= (TrieNode
const &);
59 * If found, return the private data.
60 * If not found, return NULL.
62 _SQUID_INLINE_
void *find (char const *, size_t, TrieCharTransform
*, bool const prefix
) const;
65 * returns false if the string is already
66 * present or can't be added.
70 (char const *, size_t, void *, TrieCharTransform
*);
74 /* The char index into internal is an
75 * 8-bit prefix to a string in the trie.
76 * internal[0] is the terminal node for
77 * a string and may not be used
79 TrieNode
* internal
[256];
81 /* If a string ends here, non NULL */
85 #endif /* __cplusplus */
88 #include "TrieNode.cci"
91 #endif /* LIBTRIE_TRIENODE_H */