A templated graph storing nodes of type T and edges of type U.
More...
#include <Graph.h>
|
| Graph ()=default |
| Default-constructs an empty graph.
|
|
void | addNode (const T &node) |
| Add a node to the graph.
|
|
void | addEdge (const U &edge) |
| Add an edge to the graph without checking for duplicates.
|
|
AddEdgeResult | addEdgeIfNotExists (const U &edge) |
| Attempt to add a directed edge, rejecting duplicates or crossings.
|
|
std::vector< T > | getNodes () const |
| Retrieve all nodes in the graph.
|
|
std::vector< U > | getEdges () const |
| Retrieve all edges in the graph.
|
|
A templated graph storing nodes of type T and edges of type U.
- Template Parameters
-
T | A Node type satisfying NodeConcept. |
U | An Edge type satisfying EdgeConcept<U,T>. |
◆ AddEdgeResult
Result of attempting to insert an edge with checks.
Enumerator |
---|
Success | Edge was inserted.
|
AlreadyExists | Duplicate edge.
|
Crosses | Would cross/overlap an existing edge.
|
◆ addEdge()
void Graph< T, U >::addEdge |
( |
const U & |
edge | ) |
|
|
inline |
Add an edge to the graph without checking for duplicates.
- Parameters
-
◆ addEdgeIfNotExists()
Attempt to add a directed edge, rejecting duplicates or crossings.
- Parameters
-
- Returns
-
◆ addNode()
void Graph< T, U >::addNode |
( |
const T & |
node | ) |
|
|
inline |
Add a node to the graph.
- Parameters
-
◆ getEdges()
std::vector< U > Graph< T, U >::getEdges |
( |
| ) |
const |
|
inline |
Retrieve all edges in the graph.
- Returns
- A vector of edges.
◆ getNodes()
std::vector< T > Graph< T, U >::getNodes |
( |
| ) |
const |
|
inline |
Retrieve all nodes in the graph.
- Returns
- A vector of nodes.
The documentation for this class was generated from the following file: