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

Returns the slot-index portion (without generation bits) of the node id, useful as a key into external storage. The handle is not modified.

Failure

Function cannot fail.

Usage example (Cross-references)

Usage examples (Cross-references)
        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;
                      GraphNodeIdGeneration(node_id) == 1;
        result = result && GraphNodeGetId(node) == node_id;
        result = result && GraphNodeIndex(node) == 0;
        result = result && GraphContainsNode(&graph, node_id);
Last updated on