![]() |
Shamrock 2025.10.0
Astrophysical Code
|
A graph container for managing solver nodes and edges with type-safe access. More...
#include <shamrock/include/shamrock/solvergraph/SolverGraph.hpp>
Public Member Functions | |
| std::shared_ptr< INode > | register_node_ptr_base (const std::string &name, std::shared_ptr< INode > node) |
| Register a node with the graph using a shared pointer. | |
| std::shared_ptr< IEdge > | register_edge_ptr_base (const std::string &name, std::shared_ptr< IEdge > edge) |
| Register an edge with the graph using a shared pointer. | |
| std::shared_ptr< INode > & | get_node_ptr_base (const std::string &name) |
| Retrieve a node by name as a shared pointer to the base interface. | |
| const std::shared_ptr< INode > & | get_node_ptr_base (const std::string &name) const |
| const variant | |
| std::shared_ptr< IEdge > & | get_edge_ptr_base (const std::string &name) |
| Retrieve an edge by name as a shared pointer to the base interface. | |
| const std::shared_ptr< IEdge > & | get_edge_ptr_base (const std::string &name) const |
| const variant | |
| INode & | get_node_ref_base (const std::string &name) |
| Get a reference to a node by name through the base interface. | |
| const INode & | get_node_ref_base (const std::string &name) const |
| const variant | |
| IEdge & | get_edge_ref_base (const std::string &name) |
| Get a reference to an edge by name through the base interface. | |
| const IEdge & | get_edge_ref_base (const std::string &name) const |
| const variant | |
| template<class T > | |
| std::shared_ptr< T > | register_node (const std::string &name, T &&node) |
| Register a node with automatic type deduction and shared pointer creation. | |
| template<class T > | |
| std::shared_ptr< T > | register_edge (const std::string &name, T &&edge) |
| Register an edge with automatic type deduction and shared pointer creation. | |
| template<class T > | |
| std::shared_ptr< T > | get_node_ptr (const std::string &name) |
| Get a typed shared pointer to a node by name. | |
| template<class T > | |
| std::shared_ptr< T > | get_node_ptr (const std::string &name) const |
| const variant | |
| template<class T > | |
| std::shared_ptr< T > | get_edge_ptr (const std::string &name) |
| Get a typed shared pointer to an edge by name. | |
| template<class T > | |
| std::shared_ptr< T > | get_edge_ptr (const std::string &name) const |
| const variant | |
| template<class T > | |
| T & | get_node_ref (const std::string &name) |
| Get a typed reference to a node by name. | |
| template<class T > | |
| const T & | get_node_ref (const std::string &name) const |
| const variant | |
| template<class T > | |
| T & | get_edge_ref (const std::string &name) |
| Get a typed reference to an edge by name. | |
| template<class T > | |
| const T & | get_edge_ref (const std::string &name) const |
| const variant | |
A graph container for managing solver nodes and edges with type-safe access.
The SolverGraph class provides a centralized registry for solver graph components, allowing nodes and edges to be registered by name and retrieved with type safety. It supports both polymorphic access through base interfaces and templated access for specific derived types.
Definition at line 56 of file SolverGraph.hpp.
|
inline |
Get a typed shared pointer to an edge by name.
This method performs a dynamic cast to the requested type and returns a shared pointer. Throw an exception if the cast fails.
| T | Type of the edge to retrieve |
| name | Unique identifier for the edge |
| std::invalid_argument | if no edge with the given name exists or cast fails |
Definition at line 276 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 287 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Retrieve an edge by name as a shared pointer to the base interface.
| name | Unique identifier for the edge |
| std::invalid_argument | if no edge with the given name exists |
Definition at line 135 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 145 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Get a typed reference to an edge by name.
This method performs a dynamic cast and returns a reference to the typed edge. Throws an exception if the cast fails.
| T | Type of the edge to retrieve |
| name | Unique identifier for the edge |
| std::invalid_argument | if no edge with the given name exists or cast fails |
Definition at line 330 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 336 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Get a reference to an edge by name through the base interface.
| name | Unique identifier for the edge |
| std::invalid_argument | if no edge with the given name exists |
Definition at line 181 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 186 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Get a typed shared pointer to a node by name.
This method performs a dynamic cast to the requested type and returns a shared pointer. Throw an exception if the cast fails.
| T | Type of the node to retrieve |
| name | Unique identifier for the node |
| std::invalid_argument | if no node with the given name exists or cast fails |
Definition at line 244 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 255 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Retrieve a node by name as a shared pointer to the base interface.
| name | Unique identifier for the node |
| std::invalid_argument | if no node with the given name exists |
Definition at line 109 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 119 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Get a typed reference to a node by name.
This method performs a dynamic cast and returns a reference to the typed node. Throws an exception if the cast fails.
| T | Type of the node to retrieve |
| name | Unique identifier for the node |
| std::invalid_argument | if no node with the given name exists or cast fails |
Definition at line 308 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 314 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Get a reference to a node by name through the base interface.
| name | Unique identifier for the node |
| std::invalid_argument | if no node with the given name exists |
Definition at line 165 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
const variant
Definition at line 170 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Register an edge with automatic type deduction and shared pointer creation.
This method creates a shared pointer from the provided edge instance and registers it with the graph. The edge type is automatically deduced from the template parameter.
| T | Type of the edge (must derive from IEdge) |
| name | Unique identifier for the edge |
| edge | Edge instance to register (will be moved) |
| std::invalid_argument | if an edge with the same name already exists |
Definition at line 226 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Register an edge with the graph using a shared pointer.
| name | Unique identifier for the edge |
| edge | Shared pointer to the edge instance |
| std::invalid_argument | if an edge with the same name already exists |
Definition at line 92 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Register a node with automatic type deduction and shared pointer creation.
This method creates a shared pointer from the provided node instance and registers it with the graph. The node type is automatically deduced from the template parameter.
| T | Type of the node (must derive from INode) |
| name | Unique identifier for the node |
| node | Node instance to register (will be moved) |
| std::invalid_argument | if a node with the same name already exists |
Definition at line 207 of file SolverGraph.hpp.
Here is the call graph for this function:
|
inline |
Register a node with the graph using a shared pointer.
| name | Unique identifier for the node |
| node | Shared pointer to the node instance |
| std::invalid_argument | if a node with the same name already exists |
Definition at line 75 of file SolverGraph.hpp.
Here is the call graph for this function: