Dazzle.Trie¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Dazzle.Trie¶
- classmethod new(value_destroy)¶
- Parameters:
value_destroy (
GLib.DestroyNotify
) – AGLib.DestroyNotify
, orNone
.- Returns:
A newly allocated
Dazzle.Trie
that should be freed withDazzle.Trie.unref
().- Return type:
Creates a new
Dazzle.Trie
. When a value is removed from the trie, value_destroy will be called to allow you to release any resources.
- destroy()¶
This is an alias for
Dazzle.Trie.unref
().
- insert(key, value)¶
-
Inserts value into self located with key.
- lookup(key)¶
-
Looks up key in self and returns the value associated.
- ref()¶
- Return type:
- remove(key)¶
- Parameters:
key (
str
) – The key to remove.- Returns:
- Return type:
Removes key from self, possibly destroying the value associated with the key.
- traverse(key, order, flags, max_depth, func, *user_data)¶
- Parameters:
key (
str
) – The key to start traversal from.order (
GLib.TraverseType
) – The order to traverse.flags (
GLib.TraverseFlags
) – The flags for which nodes to callback.max_depth (
int
) – the maximum depth to process.func (
Dazzle.TrieTraverseFunc
) – The func to execute for each matching node.
Traverses all nodes of self according to the parameters. For each node matching the traversal parameters, func will be executed.
Only
GLib.TraverseType.PRE_ORDER
andGLib.TraverseType.POST_ORDER
are supported for order.If max_depth is less than zero, the entire tree will be traversed. If max_depth is 1, then only the root will be traversed.
- unref()¶
Drops the reference count by one on self. When it reaches zero, the structure is freed.