ValidateGraph
Description
Validate whether a given Graph object is valid. Aborts if provided graph is uninitialized or corrupted.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in | Pointer to Graph object to validate. |
Success
Continue execution, meaning given graph is most probably valid.
Failure
abort
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.c:106:
}
ValidateGraph(graph);
graph_validate_node_id(graph, node._id_);
return node;- In
Graph.c:458:
void deinit_graph(GenericGraph *graph, size item_size) {
ValidateGraph(graph);
clear_graph(graph, item_size);- In
Graph.c:471:
u64 slot_index;
ValidateGraph(graph);
for (slot_index = 0; slot_index < VecLen(&graph->slots); slot_index++) {- In
Graph.c:506:
(void)item_size;
ValidateGraph(graph);
old_capacity = VecCapacity(&graph->slots);- In
Graph.c:532:
}
ValidateGraph(graph);
if (VecLen(&graph->free_indices)) {- In
Graph.c:633:
}
ValidateGraph(graph);
index = GraphNodeIdIndex(node_id);- In
Graph.c:649:
GraphNode node;
ValidateGraph(graph);
graph_validate_node_id(graph, node_id);- In
Graph.c:690:
GraphNeighbors *neighbors;
ValidateGraph(graph);
graph_validate_node_id(graph, from);
neighbors = graph_out_neighbors_ptr(graph, from);- In
Graph.c:704:
GraphNeighbors *neighbors;
ValidateGraph(graph);
graph_validate_node_id(graph, to);
neighbors = graph_in_neighbors_ptr(graph, to);- In
Graph.c:718:
GraphNeighbors *neighbors;
ValidateGraph(graph);
graph_validate_node_id(graph, from);
graph_validate_node_id(graph, to);- In
Graph.c:730:
GraphNeighbors *in_neighbors;
ValidateGraph(graph);
graph_validate_node_id(graph, from);
graph_validate_node_id(graph, to);- In
Graph.c:853:
GraphPendingEdgeRemoval pending;
ValidateGraph(graph);
graph_validate_node_id(graph, from);
graph_validate_node_id(graph, to);- In
Graph.c:877:
bool graph_edge_marked_for_removal(GenericGraph *graph, GraphNodeId from, GraphNodeId to) {
ValidateGraph(graph);
graph_validate_node_id(graph, from);
graph_validate_node_id(graph, to);- In
Graph.c:887:
size idx;
ValidateGraph(graph);
graph_validate_node_id(graph, from);
graph_validate_node_id(graph, to);- In
Graph.c:906:
u64 explicit_edge_removal_count;
ValidateGraph(graph);
if (!graph->pending_delete_count && !VecLen(&graph->pending_edge_removals)) {- In
Graph.c:956:
GenericGraphNodeIter iter;
ValidateGraph(graph);
iter.graph = graph;- In
Graph.c:973:
}
ValidateGraph(iter->graph);
if (iter->expected_mutation_epoch != iter->graph->mutation_epoch) {
LOG_FATAL("graph structure changed during node iteration");- In
Graph.c:1018:
}
ValidateGraph(iter->graph);
if (iter->expected_mutation_epoch != iter->graph->mutation_epoch) {
LOG_FATAL("graph structure changed during neighbor iteration");- In
Graph.c:1065:
}
ValidateGraph(iter->graph);
if (iter->expected_mutation_epoch != iter->graph->mutation_epoch) {
LOG_FATAL("graph structure changed during predecessor iteration"); GraphAddEdge(&graph, c, a);
ValidateGraph(&graph);
node_b = GraphGetNode(&graph, b);- In
Graph.Type.c:16:
IntGraph graph = GraphInit(&alloc);
ValidateGraph(&graph);
// intentional bypass: the inner `slots` / `free_indices` /
- In
Graph.Init.c:19:
GraphReserve(&graph, 8);
ValidateGraph(&graph);
bool result = VecCapacity(&graph.slots) >= 8;- 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
Insert.h:40:
///
#define GraphAddNodeL(g, lval) \
(ValidateGraph(g), \
CHECK_TYPE_EQUIVALENCE(TYPE_OF(lval), GRAPH_NODE_TYPE(g)), \
graph_push_node_owned(GENERIC_GRAPH(g), &(lval), sizeof(GRAPH_NODE_TYPE(g))))- In
Insert.h:63:
///
#define GraphAddNodeR(g, rval) \
(ValidateGraph(g), \
CHECK_TYPE_CONVERTIBLE(GRAPH_NODE_TYPE(g), rval), \
graph_push_node(GENERIC_GRAPH(g), &LVAL_AS(GRAPH_NODE_TYPE(g), rval), sizeof(GRAPH_NODE_TYPE(g))))- In
Insert.h:104:
/// TAGS: Graph, AddEdge, Directed
///
#define GraphAddEdge(g, from, to) (ValidateGraph(g), graph_add_edge(GENERIC_GRAPH(g), (from), (to)))
///
- In
Memory.h:48:
/// TAGS: Graph, Memory, Reserve
///
#define GraphReserve(g, n) (ValidateGraph(g), reserve_graph(GENERIC_GRAPH(g), sizeof(GRAPH_NODE_TYPE(g)), (n)))
///
Last updated on