Skip to content
GraphNodeIndex

GraphNodeIndex

Description

Get the slot index encoded in a traversal handle.

Slot indices are intentionally reusable after GraphCommitChanges. External arrays keyed only by GraphNodeIndex(node) must be reset when deleted slots can be reused, or paired with generation-aware logic.

Parameters

Name Direction Description
node in GraphNode handle.

Success

Slot index portion of the node id.

Failure

Function cannot fail.

Usage example (Cross-references)

Usage examples (Cross-references)
        bool result = graph.alignment == 32 && GraphNodeIdIndex(node_id) == 0 && GraphNodeIdGeneration(node_id) == 1;
        result      = result && GraphNodeGetId(node) == node_id;
        result      = result && GraphNodeIndex(node) == 0;
        result      = result && GraphContainsNode(&graph, node_id);
        result      = result && GraphNodeData(&graph, node_b) == 25;
        result      = result && GraphNodeGetId(node_b) == b;
        result      = result && GraphNodeIndex(node_b) == GraphNodeIdIndex(b);
        result      = result && GraphOutDegree(&graph, a) == 2;
        result      = result && GraphInDegree(&graph, a) == 1;
Last updated on