NEML2 2.0.0
|
The DependencyResolver identifies and resolves the dependencies among a set of objects derived from DependencyDefinition. More...
The DependencyResolver identifies and resolves the dependencies among a set of objects derived from DependencyDefinition.
Node | The type of the node in the dependency graph, i.e. if this resolver is used to figure out dependencies among Models, this template parameter should be Model. |
ItemType | The type of the consumed/provided items of each node |
#include <DependencyResolver.h>
Classes | |
struct | Item |
Public Member Functions | |
DependencyResolver ()=default | |
void | add_node (DependencyDefinition< ItemType > *) |
Add a node (defining consumed/provided items) in the dependency graph. | |
void | add_additional_outbound_item (const ItemType &item) |
Add an additional outbound item that the dependency graph provides | |
void | set_priority (DependencyDefinition< ItemType > *, size_t) |
Set a node's priority, useful for resolving cyclic dependency. | |
void | resolve () |
Resolve nodal dependency and find an evaluation order. | |
const std::vector< Node * > & | resolution () const |
The resolved (nodal) evaluation order following which all consumed items of the current node. | |
const std::map< Item, std::set< Item > > & | item_providers () const |
const std::map< Item, std::set< Item > > & | item_consumers () const |
const std::map< Node *, std::set< Node * > > & | node_providers () const |
const std::map< Node *, std::set< Node * > > & | node_consumers () const |
const std::set< Node * > & | end_nodes () const |
End nodes which are not consumed by anyone else. | |
const std::set< Item > & | outbound_items () const |
The items provided by the overall dependency graph, i.e., the items that are not consumed by any node. | |
const std::set< Node * > & | start_nodes () const |
Start nodes which do not consume anyone else. | |
const std::set< Item > & | inbound_items () const |
The items consumed by the overall dependency graph, i.e., the items that are not provided by any node. | |
bool & | unique_item_provider () |
bool & | unique_item_consumer () |
|
default |
Add an additional outbound item that the dependency graph provides
void add_node | ( | DependencyDefinition< ItemType > * | def | ) |
Add a node (defining consumed/provided items) in the dependency graph.
End nodes which are not consumed by anyone else.
The items consumed by the overall dependency graph, i.e., the items that are not provided by any node.
The item-item consumer dictionary: key of the dictionary is the item of interest, and the value of the dictionary is the set of items that consume the item of interest.
The item-item provider dictionary: key of the dictionary is the item of interest, and the value of the dictionary is the set of items that provide the item of interest.
The node-node consumer dictionary: key of the dictionary is the node of interest, and the value of the dictionary is the set of nodes that consume the item of interest.
The node-node provider dictionary: key of the dictionary is the node of interest, and the value of the dictionary is the set of nodes that provide the item of interest.
The items provided by the overall dependency graph, i.e., the items that are not consumed by any node.
The resolved (nodal) evaluation order following which all consumed items of the current node.
Resolve nodal dependency and find an evaluation order.
void set_priority | ( | DependencyDefinition< ItemType > * | def, |
size_t | priority ) |
Set a node's priority, useful for resolving cyclic dependency.
Start nodes which do not consume anyone else.