GraphNodeCount
Description
Number of live nodes currently stored in graph. Includes nodes marked for deletion but not yet committed.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in | Graph to query. |
Success
Returns the live-node count as a u64. The graph is not modified.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Foreach.h:36:
#define GraphForeachNode(g, node) \
for (TYPE_OF(g) UNPL(pg) = (g); UNPL(pg); UNPL(pg) = NULL) \
if ((ValidateGraph(UNPL(pg)), 1) && GraphNodeCount(UNPL(pg)) > 0) \
for (GenericGraphNodeIter UNPL(iter) = graph_node_iter_begin(GENERIC_GRAPH(UNPL(pg))); UNPL(iter).graph; \
UNPL(iter).graph = NULL) \- In
Access.h:90:
/// TAGS: Graph, Empty, Query
///
#define GraphEmpty(g) (GraphNodeCount(g) == 0)
///
- In
Ops.c:59:
result = result && (removed == 1);
result = result && (GraphNodeCount(&graph) == 2);
result = result && (GraphEdgeCount(&graph) == 1);
result = result && !GraphContainsNode(&graph, b);- In
Ops.c:100:
result = result && (GraphCommitChanges(&graph) == 0);
result = result && GraphContainsNode(&graph, a);
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);- In
Ops.c:268:
result = result && (GraphCommitChanges(&graph) == 2);
result = result && !GraphContainsNode(&graph, b);
result = result && (GraphNodeCount(&graph) == 3);
result = result && (GraphEdgeCount(&graph) == 0);
result = result && (GraphOutDegree(&graph, a) == 0);- In
Ops.c:374:
result = result && (GraphEdgeCount(&graph) == 1);
result = result && (GraphNeighborAt(&graph, a, 0) == c);
result = result && (GraphNodeCount(&graph) == 2);
GraphDeinit(&graph);- In
Ops.c:409:
GraphNodeId c = GraphAddNodeR(&graph, 30);
result = result && GraphContainsNode(&graph, c);
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);- In
Ops.c:443:
GraphNodeId c = GraphAddNodeR(&graph, 30);
result = result && GraphContainsNode(&graph, c);
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);- In
Ops.c:483:
result = result && !GraphContainsNode(&graph, a);
result = result && GraphContainsNode(&graph, c);
result = result && (GraphNodeCount(&graph) == 1);
result = result && (GraphEdgeCount(&graph) == 0);
result = result && (GraphInDegree(&graph, c) == 0);- In
Init.c:47:
GraphClear(&graph);
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);- In
Init.c:94:
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
Init.c:118:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && GraphNodeCount(&graph) == 1 && StrBegin(stored_name) != NULL &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0;- In
Insert.c:199:
result = result && (GraphNodeIdIndex(reused) == GraphNodeIdIndex(b));
result = result && (GraphNodeAt(&graph, reused) == 40);
result = result && (GraphNodeCount(&graph) == 2);
GraphDeinit(&graph);- In
Insert.c:276:
// Real code frees the node-data buffer on the failure path; mutant leaks it.
result = result && (after == before);
result = result && (GraphNodeCount(&graph) == 0);
GraphDeinit(&graph);- In
Insert.c:318:
// Real code frees the node-data buffer; mutant leaks it.
result = result && (after == before);
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);- In
Type.c:30:
// are read directly here to verify the default-constructed graph has
// every internal cursor / table empty.
bool result = GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph) &&
VecBegin(&graph.slots) == NULL && VecBegin(&graph.free_indices) == NULL &&
VecBegin(&graph.pending_edge_removals) == NULL && GraphCopyInit(&graph) == NULL &&- In
Type.c:93:
bool result = (graph.pending_delete_count == 1);
result = result && (GraphNodeCount(&graph) == 3);
GraphDeinit(&graph);- In
Foreach.c:347:
bool result = (visited == 2);
result = result && (GraphNodeCount(&graph) == 2);
GraphDeinit(&graph);- In
Access.c:37:
*GraphNodeDataPtr(&graph, node_b) = 25;
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;
Last updated on