Tree

class Tree(pointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance

The GTree struct is an opaque data structure representing a glib-Balanced-Binary-Trees. It should be accessed only by using the following functions.

Skipped during bindings generation

  • method insert_node: Return type TreeNode is unsupported

  • parameter orig_key: orig_key: Out parameter is not supported

  • method lookup_node: Return type TreeNode is unsupported

  • method lower_bound: Return type TreeNode is unsupported

  • method node_first: Return type TreeNode is unsupported

  • method node_last: Return type TreeNode is unsupported

  • method replace_node: Return type TreeNode is unsupported

  • method search_node: Return type TreeNode is unsupported

  • method traverse: C function g_tree_traverse is ignored

  • method upper_bound: Return type TreeNode is unsupported

  • parameter key_compare_func: CompareFunc

  • parameter key_destroy_func: DestroyNotify

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val glibTreePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>?

Functions

Link copied to clipboard
fun destroy()

Removes all keys and values from the #GTree and decreases its reference count by one. If keys and/or values are dynamically allocated, you should either free them first or create the #GTree using g_tree_new_full(). In the latter case the destroy functions you supplied will be called on all keys and values before destroying the #GTree.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard

Calls the given function for each of the key/value pairs in the #GTree. The function is passed the key and value of each pair, and the given

Link copied to clipboard

Calls the given function for each of the nodes in the #GTree. The function is passed the pointer to the particular node, and the given

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun height(): <Error class: unknown class>

Gets the height of a #GTree.

Link copied to clipboard
fun insert(key: <Error class: unknown class>? = null, value: <Error class: unknown class>? = null)

Inserts a key/value pair into a #GTree.

Link copied to clipboard
fun lookup(key: <Error class: unknown class>? = null): <Error class: unknown class>?

Gets the value corresponding to the given key. Since a #GTree is automatically balanced as key/value pairs are added, key lookup is O(log n) (where n is the number of key/value pairs in the tree).

Link copied to clipboard
fun nnodes(): <Error class: unknown class>

Gets the number of nodes in a #GTree.

Link copied to clipboard
fun ref(): Tree

Increments the reference count of @tree by one.

Link copied to clipboard
fun remove(key: <Error class: unknown class>? = null): Boolean

Removes a key/value pair from a #GTree.

Link copied to clipboard
fun removeAll()

Removes all nodes from a #GTree and destroys their keys and values, then resets the #GTree’s root to null.

Link copied to clipboard
fun replace(key: <Error class: unknown class>? = null, value: <Error class: unknown class>? = null)

Inserts a new key and value into a #GTree as g_tree_replace_node() does, only this function does not return the inserted or set node.

Link copied to clipboard
fun search(searchFunc: CompareFunc): <Error class: unknown class>?

Searches a #GTree using @search_func.

Link copied to clipboard
fun steal(key: <Error class: unknown class>? = null): Boolean

Removes a key and its associated value from a #GTree without calling the key and value destroy functions.

Link copied to clipboard
fun unref()

Decrements the reference count of @tree by one. If the reference count drops to 0, all keys and values will be destroyed (if destroy functions were specified) and all memory allocated by @tree will be released.