Header menu logo OutlineAlgorithm

InteropCSharp Type

C#-friendly API using .NET delegate types and standard collections.

Static members

Static member Description

InteropCSharp.BreadthFirstTraversal(tree, onEnter, onExit)

Full Usage: InteropCSharp.BreadthFirstTraversal(tree, onEnter, onExit)

Parameters:
    tree : InteropTree<'a> - The InteropTree to traverse.
    onEnter : Action<'a> - Action to invoke when entering a node with a value.
    onExit : Action<'a> - Action to invoke when exiting a node with a value.

Performs breadth-first traversal using Action delegates. Only nodes with values are visited. Dummy nodes are not visited.

tree : InteropTree<'a>

The InteropTree to traverse.

onEnter : Action<'a>

Action to invoke when entering a node with a value.

onExit : Action<'a>

Action to invoke when exiting a node with a value.

InteropCSharp.CreateTree(elements, getRank)

Full Usage: InteropCSharp.CreateTree(elements, getRank)

Parameters:
    elements : IEnumerable<'a> - The sequence of elements to convert.
    getRank : Func<'a, int> - A Func delegate returning the nesting level (rank) of each element.

Returns: InteropTree<'a> An InteropTree representing the reconstructed hierarchy.

Converts a sequence of elements and rank function into an InteropTree structure.

elements : IEnumerable<'a>

The sequence of elements to convert.

getRank : Func<'a, int>

A Func delegate returning the nesting level (rank) of each element.

Returns: InteropTree<'a>

An InteropTree representing the reconstructed hierarchy.

InteropCSharp.DepthFirstTraversal(tree, onEnter, onExit)

Full Usage: InteropCSharp.DepthFirstTraversal(tree, onEnter, onExit)

Parameters:
    tree : InteropTree<'a> - The InteropTree to traverse.
    onEnter : Action<'a> - Action to invoke when entering a node with a value.
    onExit : Action<'a> - Action to invoke when exiting a node with a value.

Performs depth-first traversal using Action delegates. Only nodes with values are visited. Dummy nodes are not visited.

tree : InteropTree<'a>

The InteropTree to traverse.

onEnter : Action<'a>

Action to invoke when entering a node with a value.

onExit : Action<'a>

Action to invoke when exiting a node with a value.

InteropCSharp.TraverseWithOutlineIndex(tree, action)

Full Usage: InteropCSharp.TraverseWithOutlineIndex(tree, action)

Parameters:
    tree : InteropTree<'a> - The InteropTree to traverse.
    action : Action<'a, IReadOnlyList<int>> - Action to invoke with the node value and its outline index (e.g., [1, 2, 3]).

Traverses the tree and invokes the Action with outline index for each node with a value. Dummy nodes are not visited.

tree : InteropTree<'a>

The InteropTree to traverse.

action : Action<'a, IReadOnlyList<int>>

Action to invoke with the node value and its outline index (e.g., [1, 2, 3]).

Type something to start searching.