GraphMarkNodeForDeletion
Description
Mark a node for deletion on the next GraphCommitChanges.
Marked nodes remain visible until commit. This operation is safe during graph traversal and is intended for destructive passes that need stable iteration.
Parameters
| Name | Direction | Description |
|---|---|---|
node |
in | GraphNode handle to mark. |
Success
true when the node was newly marked.
Failure
false when the node was already marked.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.Ops.c:30:
static bool test_graph_mark_delete_commit_and_reuse(void) {
WriteFmt("Testing GraphMarkNodeForDeletion and GraphCommitChanges\n");
typedef Graph(int) IntGraph;- In
Graph.Ops.c:45:
GraphForeachNode(&graph, node) {
if (GraphNodeData(&graph, node) == 20) {
GraphMarkNodeForDeletion(node);
}
}- In
Graph.Ops.c:83:
bool result = !GraphNodeMarkedForDeletion(node);
result = result && GraphMarkNodeForDeletion(node);
result = result && GraphNodeMarkedForDeletion(node);
result = result && !GraphMarkNodeForDeletion(node);- In
Graph.Ops.c:85:
result = result && GraphMarkNodeForDeletion(node);
result = result && GraphNodeMarkedForDeletion(node);
result = result && !GraphMarkNodeForDeletion(node);
result = result && GraphUnmarkNodeForDeletion(node);
result = result && !GraphNodeMarkedForDeletion(node);- In
Graph.Ops.c:239:
bool result = GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphMarkNodeForDeletion(GraphGetNode(&graph, b));
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphNodeMarkedForDeletion(GraphGetNode(&graph, b));- In
Graph.Ops.c:269:
counts[GraphNodeIdIndex(b)] = 29;
bool result = GraphMarkNodeForDeletion(GraphGetNode(&graph, b));
result = result && (GraphCommitChanges(&graph) == 1);
result = result && !GraphContainsNode(&graph, b);- In
Graph.Ops.c:297:
GraphNode node = GraphGetNode(&graph, a);
(void)GraphMarkNodeForDeletion(node);
(void)GraphCommitChanges(&graph);
(void)GraphNodeVisit(node);- In
Graph.Init.c:32:
result = result && GraphAddEdge(&graph, third_id, third_id);
result = result && (GraphNodeVisit(GraphGetNode(&graph, first_id)) == 1);
result = result && GraphMarkNodeForDeletion(GraphGetNode(&graph, second_id));
result = result && GraphMarkEdgeForRemoval(&graph, third_id, third_id);
Last updated on