GraphNodeIdIndex
Description
Extract the slot index encoded in a node id.
Parameters
| Name | Direction | Description |
|---|---|---|
id |
in | Graph node id. |
Success
Low 32-bit slot index encoded in id.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.c:69:
const GenericGraphSlot *slot;
index = GraphNodeIdIndex(node_id);
generation = GraphNodeIdGeneration(node_id);- In
Graph.c:90:
static GenericGraphSlot *graph_require_live_slot(GenericGraph *graph, GraphNodeId node_id) {
graph_validate_node_id(graph, node_id);
return graph_slot_ptr_raw(graph, GraphNodeIdIndex(node_id));
}- In
Graph.c:95:
static const GenericGraphSlot *graph_require_live_slot_const(const GenericGraph *graph, GraphNodeId node_id) {
graph_validate_node_id(graph, node_id);
return graph_slot_ptr_const_raw(graph, GraphNodeIdIndex(node_id));
}- In
Graph.c:267:
const GenericGraphSlot *slot;
graph_validate_node_index_raw(graph, GraphNodeIdIndex(neighbor_id));
slot = graph_slot_ptr_const_raw(graph, GraphNodeIdIndex(neighbor_id));- In
Graph.c:268:
graph_validate_node_index_raw(graph, GraphNodeIdIndex(neighbor_id));
slot = graph_slot_ptr_const_raw(graph, GraphNodeIdIndex(neighbor_id));
if (graph_slot_is_occupied(slot) && !graph_slot_is_marked(slot) &&- In
Graph.c:635:
ValidateGraph(graph);
index = GraphNodeIdIndex(node_id);
generation = GraphNodeIdGeneration(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;- In
Graph.Type.c:45:
GraphNode node = GraphGetNode(&graph, node_id);
bool result = GraphAllocator(&graph)->alignment == 32 && GraphNodeIdIndex(node_id) == 0 &&
GraphNodeIdGeneration(node_id) == 1;
result = result && GraphNodeGetId(node) == node_id;- In
Graph.Ops.c:70:
GraphNodeId d = GraphAddNodeR(&graph, 40);
result = result && (GraphNodeIdIndex(d) == GraphNodeIdIndex(b));
result = result && (GraphNodeIdGeneration(d) == (GraphNodeIdGeneration(b) + 1));
result = result && (GraphNodeData(&graph, GraphGetNode(&graph, d)) == 40);- In
Graph.Ops.c:293:
u64 counts[2] = {0};
counts[GraphNodeIdIndex(a)] = 11;
counts[GraphNodeIdIndex(b)] = 29;- In
Graph.Ops.c:294:
counts[GraphNodeIdIndex(a)] = 11;
counts[GraphNodeIdIndex(b)] = 29;
bool result = GraphMarkNodeForDeletion(GraphGetNode(&graph, b));- In
Graph.Ops.c:302:
GraphNodeId reused = GraphAddNodeR(&graph, 99);
result = result && (GraphNodeIdIndex(reused) == GraphNodeIdIndex(b));
result = result && (GraphNodeIdGeneration(reused) == (GraphNodeIdGeneration(b) + 1));
result = result && (counts[GraphNodeIdIndex(reused)] == 29);- In
Graph.Ops.c:304:
result = result && (GraphNodeIdIndex(reused) == GraphNodeIdIndex(b));
result = result && (GraphNodeIdGeneration(reused) == (GraphNodeIdGeneration(b) + 1));
result = result && (counts[GraphNodeIdIndex(reused)] == 29);
counts[GraphNodeIdIndex(reused)] = 0;- In
Graph.Ops.c:306:
result = result && (counts[GraphNodeIdIndex(reused)] == 29);
counts[GraphNodeIdIndex(reused)] = 0;
result = result && (counts[GraphNodeIdIndex(reused)] == 0);
result = result && (counts[GraphNodeIdIndex(a)] == 11);- In
Graph.Ops.c:307:
counts[GraphNodeIdIndex(reused)] = 0;
result = result && (counts[GraphNodeIdIndex(reused)] == 0);
result = result && (counts[GraphNodeIdIndex(a)] == 11);
result = result && (GraphNodeAt(&graph, reused) == 99);- In
Graph.Ops.c:308:
counts[GraphNodeIdIndex(reused)] = 0;
result = result && (counts[GraphNodeIdIndex(reused)] == 0);
result = result && (counts[GraphNodeIdIndex(a)] == 11);
result = result && (GraphNodeAt(&graph, reused) == 99);- In
Graph.Init.c:64:
}
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(first_id))->generation == (first_generation + 1));
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(second_id))->generation == (second_generation + 1));
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(third_id))->generation == (third_generation + 1));- In
Graph.Init.c:65:
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(first_id))->generation == (first_generation + 1));
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(second_id))->generation == (second_generation + 1));
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(third_id))->generation == (third_generation + 1));- In
Graph.Init.c:66:
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(first_id))->generation == (first_generation + 1));
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(second_id))->generation == (second_generation + 1));
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(third_id))->generation == (third_generation + 1));
GraphDeinit(&graph);- In
Graph.Init.c:89:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && StrBegin(&name) != NULL && GraphNodeCount(&graph) == 1 &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0 && StrBegin(stored_name) != StrBegin(&name);- In
Graph.Init.c:113:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && GraphNodeCount(&graph) == 1 && StrBegin(stored_name) != NULL &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0; GraphNodeId id1 = GraphAddNodeR(&graph, shared);
bool result = GraphNodeIdIndex(id0) == 0 && GraphNodeIdGeneration(id0) == 1 && GraphNodeIdIndex(id1) == 1;
result = result && owned == 0 && shared == 7;
result = result && GraphNodeAt(&graph, id0) == 42;- In
Access.h:156:
/// TAGS: Graph, Node, Index, Handle
///
#define GraphNodeIndex(node) GraphNodeIdIndex(GraphNodeGetId(node))
///
Last updated on