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:90:
const GenericGraphSlot *slot;
index = GraphNodeIdIndex(node_id);
generation = GraphNodeIdGeneration(node_id);- In
Graph.c:111:
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:116:
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:305:
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:306:
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) && (slot->generation == GraphNodeIdGeneration(neighbor_id))) {- In
Graph.c:612:
ValidateGraph(graph);
index = GraphNodeIdIndex(node_id);
generation = GraphNodeIdGeneration(node_id);- In
Graph.Ops.c:64:
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:266:
u64 counts[2] = {0};
counts[GraphNodeIdIndex(a)] = 11;
counts[GraphNodeIdIndex(b)] = 29;- In
Graph.Ops.c:267:
counts[GraphNodeIdIndex(a)] = 11;
counts[GraphNodeIdIndex(b)] = 29;
bool result = GraphMarkNodeForDeletion(GraphGetNode(&graph, b));- In
Graph.Ops.c:275:
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:277:
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:279:
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:280:
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:281:
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:53:
}
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:54:
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:55:
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:75:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && name.data != NULL && GraphNodeCount(&graph) == 1 &&
ZstrCompare(stored_name->data, "alpha") == 0 && stored_name->data != name.data;- In
Graph.Type.c:33:
GraphNode node = GraphGetNode(&graph, node_id);
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 && 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; 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:104:
/// TAGS: Graph, Node, Index, Handle
///
#define GraphNodeIndex(node) GraphNodeIdIndex(GraphNodeGetId(node))
///
Last updated on