|
The Pedigree Project 0.1
|
A key/value dictionary for string keys. More...
#include <RadixTree.h>
Inheritance diagram for RadixTree< T >:
Collaboration diagram for RadixTree< T >:Classes | |
| class | Node |
Public Types | |
| typedef ::Iterator< T, Node > | Iterator |
| typedef Iterator::Const | ConstIterator |
| typedef Result< T, bool > | LookupType |
Public Member Functions | |
| RadixTree () | |
| RadixTree (const RadixTree< T > &x) | |
| RadixTree (bool bCaseSensitive) | |
| ~RadixTree () | |
| RadixTree & | operator= (const RadixTree &x) |
| size_t | count () const |
| void | insert (const String &key, const T &value) |
| MUST_USE_RESULT bool | lookup (const String &key, T &value) const |
| template<typename U = T> | |
| pedigree_std::enable_if< pedigree_std::is_same< U, T >::value &&!pedigree_std::is_same< U, void * >::value, LookupType >::type | lookup (const String &key) const |
| void | remove (const String &key) |
| void | clear () |
| Iterator | erase (Iterator iter) |
| Iterator | begin () |
| ConstIterator | begin () const |
| Iterator | end () |
| ConstIterator | end () const |
| void | dump (void(*emit_line)(const char *s)) const |
Private Member Functions | |
| Node * | cloneNode (Node *node, Node *parent) |
| Node * | getNewNode () |
| void | returnNode (Node *p) |
Private Attributes | |
| size_t | m_nItems |
| Node * | m_pRoot |
| const bool | m_bCaseSensitive |
| ObjectPool< Node > | m_NodePool |
A key/value dictionary for string keys.
Dictionary class, aka Map for string keys. This is implemented as a Radix Tree - also known as a Patricia Trie.
Definition at line 46 of file RadixTree.h.
| typedef Iterator::Const RadixTree< T >::ConstIterator |
Type of the constant bidirectional iterator
Definition at line 183 of file RadixTree.h.
| typedef ::Iterator<T, Node> RadixTree< T >::Iterator |
Type of the bidirectional iterator
Definition at line 181 of file RadixTree.h.
Definition at line 184 of file RadixTree.h.
Get an iterator pointing to the beginning of the List
Definition at line 250 of file RadixTree.h.
|
inline |
Get a constant iterator pointing to the beginning of the List
Definition at line 258 of file RadixTree.h.
Get an iterator pointing to the end of the List + 1
Definition at line 266 of file RadixTree.h.
|
inline |
Get a constant iterator pointing to the end of the List + 1
Definition at line 271 of file RadixTree.h.
Erase one Element
Definition at line 240 of file RadixTree.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::__getNode(), and RadixTree< T >::Node::next().
Obtain a new Node with the same case-sensitive flag.
Definition at line 282 of file RadixTree.h.
References RadixTree< T >::Node::m_pParent, and RadixTree< T >::Node::m_pParentTree.
|
inline |
Ergonomic lookup for locally instantiated trees.
RadixTree<void *> is explicitly instantiated by the kernel and consumed by modules built with another compiler, so its aggregate Result-returning overload is intentionally unavailable.
Definition at line 226 of file RadixTree.h.
Return a Node so it can be allocated again.
Definition at line 289 of file RadixTree.h.
References RadixTree< T >::Node::m_bHasValue, RadixTree< T >::Node::m_Key, RadixTree< T >::Node::m_pParent, and RadixTree< T >::Node::value.
Referenced by RadixTree< T >::RadixTree().
Here is the caller graph for this function:
|
private |
Whether matches are case-sensitive or not.
Definition at line 306 of file RadixTree.h.
Referenced by RadixTree< T >::Node::matchKey().
|
private |
Number of items in the tree.
Definition at line 302 of file RadixTree.h.
Referenced by RadixTree< T >::RadixTree().
|
private |
Pool of node objects (to reduce impact of lots of node allocs/deallocs).
Definition at line 309 of file RadixTree.h.
The tree's root.
Definition at line 304 of file RadixTree.h.
Referenced by RadixTree< T >::RadixTree().