GraphEdgeMarkedForRemoval
Description
Check whether an edge is currently marked for removal.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in | Graph owning the edge. |
from |
in | Source node id. |
to |
in | Destination node id. |
Success
Returns true when the edge is flagged for removal but not yet committed. The graph is not modified.
Failure
Returns false when the edge is absent or not marked. The graph is not modified.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Ops.c:169:
GraphAddEdge(&graph, a, b);
bool result = !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);- In
Ops.c:171:
bool result = !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && !GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);- In
Ops.c:174:
result = result && !GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && !GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && (GraphCommitChanges(&graph) == 0);- In
Ops.c:202:
bool result = GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphMarkEdgeForRemoval(&graph, a, c);
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);- In
Ops.c:203:
result = result && GraphMarkEdgeForRemoval(&graph, a, c);
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);- In
Ops.c:205:
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);
result = result && (GraphCommitChanges(&graph) == 1);- In
Ops.c:206:
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);
result = result && (GraphCommitChanges(&graph) == 1);
result = result && GraphHasEdge(&graph, a, b);- In
Ops.c:264:
bool result = GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphMarkNodeForDeletion(GraphGetNode(&graph, b));
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphNodeMarkedForDeletion(GraphGetNode(&graph, b));
result = result && (GraphCommitChanges(&graph) == 2);- In
Ops.c:496:
// validation graph_find_pending_edge_removal_index just returns "not found".
static bool test_edge_marked_stale_from_deadend(void) {
WriteFmt("Testing GraphEdgeMarkedForRemoval rejects a stale from id (should abort)\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Ops.c:510:
(void)GraphAddNodeR(&graph, 99); // reuse a's slot, a is now stale
(void)GraphEdgeMarkedForRemoval(&graph, a, b);
GraphDeinit(&graph);- In
Ops.c:520:
// valid `from` with a stale `to` must abort.
static bool test_edge_marked_stale_to_deadend(void) {
WriteFmt("Testing GraphEdgeMarkedForRemoval rejects a stale to id (should abort)\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Ops.c:534:
(void)GraphAddNodeR(&graph, 99); // reuse b's slot, b is now stale
(void)GraphEdgeMarkedForRemoval(&graph, a, b);
GraphDeinit(&graph);
Last updated on