![]() |
Shamrock 2025.10.0
Astrophysical Code
|
A graph container for managing solver nodes and edges with type-safe access. More...
#include <shamsolvergraph/include/shamsolvergraph/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 | |
| bool | has_node (const std::string &name) const |
| Check whether a node with the given name exists. | |
| bool | has_edge (const std::string &name) const |
| Check whether an edge with the given name exists. | |
| 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 | |
| std::vector< std::string > | get_edge_names () const |
| Returns edge registration keys in lexicographic order (deterministic). | |
| std::vector< std::string > | get_node_names () const |
| Returns node registration keys in lexicographic order (deterministic). | |
Static Public Member Functions | |
| static SolverGraph | with_constraint (SolverGraphConstraint graph_constraint) |
| Create a solver graph with registration constraints. | |
Protected Member Functions | |
| SolverGraph (SolverGraphConstraint graph_constraint) | |
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 110 of file SolverGraph.hpp.
|
inlineexplicitprotected |
Definition at line 120 of file SolverGraph.hpp.
|
inline |
Returns edge registration keys in lexicographic order (deterministic).
Definition at line 456 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 391 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 402 of file SolverGraph.hpp.
|
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 228 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 238 of file SolverGraph.hpp.
|
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 445 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 451 of file SolverGraph.hpp.
|
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 294 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 299 of file SolverGraph.hpp.
|
inline |
Returns node registration keys in lexicographic order (deterministic).
Definition at line 468 of file SolverGraph.hpp.
|
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 359 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 370 of file SolverGraph.hpp.
|
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 202 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 212 of file SolverGraph.hpp.
|
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 423 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 429 of file SolverGraph.hpp.
|
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 278 of file SolverGraph.hpp.
|
inline |
const variant
Definition at line 283 of file SolverGraph.hpp.
|
inline |
Check whether an edge with the given name exists.
| name | Unique identifier for the edge |
Definition at line 263 of file SolverGraph.hpp.
|
inline |
Check whether a node with the given name exists.
| name | Unique identifier for the node |
Definition at line 253 of file SolverGraph.hpp.
|
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 constraint validation fails or an edge with the same name already exists |
Definition at line 341 of file SolverGraph.hpp.
|
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 constraint validation fails or an edge with the same name already exists |
Definition at line 175 of file SolverGraph.hpp.
|
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 constraint validation fails or a node with the same name already exists |
Definition at line 321 of file SolverGraph.hpp.
|
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 constraint validation fails or a node with the same name already exists |
Definition at line 147 of file SolverGraph.hpp.
|
inlinestatic |
Create a solver graph with registration constraints.
| graph_constraint | Named constraint with optional node and edge checks |
Definition at line 135 of file SolverGraph.hpp.