|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Generic directed graph (digraph) wrapper template. More...
#include <graph-dry.H>
Public Types | |
| using | GT = BaseGraph |
| using | Node = typename BaseGraph::Node |
| using | Arc = typename BaseGraph::Arc |
Public Member Functions | |
| Digraph () noexcept | |
| Default constructor. | |
| Digraph (const Digraph &dg) | |
| Copy constructor. | |
| Digraph (Digraph &&dg) noexcept | |
| Move constructor. | |
| Digraph & | operator= (const Digraph &g) |
| Copy assignment operator. | |
| Digraph & | operator= (Digraph &&g) noexcept |
| Move assignment operator. | |
Generic directed graph (digraph) wrapper template.
This template wraps any undirected graph class and converts it into a directed graph by setting the digraph flag to true. This eliminates code duplication across the various digraph implementations (List_Digraph, List_SDigraph, Array_Digraph).
The wrapper properly handles:
copy_graph)| BaseGraph | The undirected graph class to wrap (e.g., List_Graph, List_SGraph, Array_Graph). |
Example usage: cpp Instead of defining a separate List_Digraph class: template <typename Node, typename Arc> using List_Digraph = Digraph<List_Graph<Node, Arc>>;
Definition at line 3847 of file graph-dry.H.
| using Aleph::Digraph< BaseGraph >::Arc = typename BaseGraph::Arc |
Definition at line 3852 of file graph-dry.H.
| using Aleph::Digraph< BaseGraph >::GT = BaseGraph |
Definition at line 3850 of file graph-dry.H.
| using Aleph::Digraph< BaseGraph >::Node = typename BaseGraph::Node |
Definition at line 3851 of file graph-dry.H.
|
inlinenoexcept |
|
inline |
Copy constructor.
Creates a deep copy of the given digraph. All nodes and arcs are duplicated, preserving the graph topology.
| [in] | dg | The digraph to copy. |
Definition at line 3870 of file graph-dry.H.
References Aleph::copy_graph().
|
inlinenoexcept |
Move constructor.
Transfers ownership of all nodes and arcs from dg to this digraph. After the move, dg will be empty.
| [in] | dg | The digraph to move from. |
Definition at line 3883 of file graph-dry.H.
References Aleph::swap().
|
inline |
Copy assignment operator.
Replaces the contents of this digraph with a deep copy of g. All existing nodes and arcs are removed first.
| [in] | g | The digraph to copy. |
Definition at line 3897 of file graph-dry.H.
References Aleph::copy_graph().
|
inlinenoexcept |
Move assignment operator.
Transfers ownership of all nodes and arcs from g to this digraph. After the move, g will be empty.
| [in] | g | The digraph to move from. |
Definition at line 3916 of file graph-dry.H.
References Aleph::swap().