GraphContainsNode
Description
Check whether graph currently contains the provided node id.
Marked nodes still count as present until GraphCommitChanges is called. This is the safe probe to use before deciding whether an old stored id is still live.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in | Graph to query. |
node_id |
in | Node id to check. |
Success
true when node_id currently refers to a live node.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.Ops.c:49:
}
bool result = GraphContainsNode(&graph, b) && (graph.pending_delete_count == 1);
u64 removed = GraphCommitChanges(&graph);- In
Graph.Ops.c:55:
result = result && (GraphNodeCount(&graph) == 2);
result = result && (GraphEdgeCount(&graph) == 1);
result = result && !GraphContainsNode(&graph, b);
result = result && (GraphOutDegree(&graph, a) == 0);
result = result && (GraphInDegree(&graph, a) == 1);- In
Graph.Ops.c:90:
result = result && !GraphUnmarkNodeForDeletion(node);
result = result && (GraphCommitChanges(&graph) == 0);
result = result && GraphContainsNode(&graph, a);
result = result && (GraphNodeCount(&graph) == 1);- In
Graph.Ops.c:243:
result = result && GraphNodeMarkedForDeletion(GraphGetNode(&graph, b));
result = result && (GraphCommitChanges(&graph) == 2);
result = result && !GraphContainsNode(&graph, b);
result = result && (GraphNodeCount(&graph) == 3);
result = result && (GraphEdgeCount(&graph) == 0);- In
Graph.Ops.c:271:
bool result = GraphMarkNodeForDeletion(GraphGetNode(&graph, b));
result = result && (GraphCommitChanges(&graph) == 1);
result = result && !GraphContainsNode(&graph, b);
GraphNodeId reused = GraphAddNodeR(&graph, 99);- In
Graph.Init.c:38:
result = result && GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph);
result = result && !GraphContainsNode(&graph, first_id) && !GraphContainsNode(&graph, second_id);
result = result && !GraphContainsNode(&graph, third_id);
result = result && graph.slots.length == slot_count && graph.free_indices.length == slot_count;- In
Graph.Init.c:39:
result = result && GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph);
result = result && !GraphContainsNode(&graph, first_id) && !GraphContainsNode(&graph, second_id);
result = result && !GraphContainsNode(&graph, third_id);
result = result && graph.slots.length == slot_count && graph.free_indices.length == slot_count;
result = result && graph.slots.capacity == slot_capacity && graph.free_indices.capacity >= slot_count;- In
Graph.Type.c:36:
result = result && GraphNodeGetId(node) == node_id;
result = result && GraphNodeIndex(node) == 0;
result = result && GraphContainsNode(&graph, node_id);
GraphDeinit(&graph);
bool result = GraphNodeCount(&graph) == 3 && GraphEdgeCount(&graph) == 3 && !GraphEmpty(&graph);
result = result && GraphContainsNode(&graph, a) && GraphContainsNode(&graph, b) && GraphContainsNode(&graph, c);
result = result && GraphNodeAt(&graph, b) == 25;
result = result && GraphNodeData(&graph, node_b) == 25;
Last updated on