Skip to content

GraphEmpty

Description

Check whether graph contains no live nodes.

Parameters

Name Direction Description
g in Graph to query.

Success

true when graph has zero live nodes.

Failure

false

Usage example (Cross-references)

Usage examples (Cross-references)
        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);
        ValidateGraph(&graph);
    
        bool result = GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph) &&
                      graph.slots.data == NULL && graph.free_indices.data == NULL &&
                      graph.pending_edge_removals.data == NULL && graph.copy_init == NULL && graph.copy_deinit == NULL &&
        *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