3#include "Engine/Network/NetworkPath.h"
4#include "Engine/Network/Node.h"
5#include "Engine/Network/Scope.h"
6#include "Engine/NetworkGraph/NetworkGraph.h"
10#include <unordered_map>
32 using NodeStore = std::unordered_map<NodeId, std::unique_ptr<Node>>;
45 return std::views::transform(nodes_, [](NodeStore::value_type& entry) {
46 return std::pair<const NodeId, Node&>(entry.first, *entry.second);
94 std::weak_ptr<prm::NodeParameter>
110 void createScope(
const Path& path,
const std::string& scopeType);
111 void deleteScope(
const Path& path);
117 std::unordered_map<std::string, Scope> scopes_;
Basic attribute, parameter, and node types for Enzo.
uint64_t NodeId
The unique ID assigned to each node in the network.
Definition Types.h:306
A path that references a network entity, either a node or a parameter on a node.
Definition NetworkPath.h:20
A default path class for creation and manipulation of tree-based paths.
Definition Path.h:14
The single owner of the network's wiring and dependencies.
Definition NetworkGraph.h:24
Every node in a scene, their wiring, and the scopes they live in.
Definition Network.h:30
void deleteNode(NodeId nodeId)
Drops a node, the scope it held, and its wiring.
Definition Network.cpp:55
Node * getNodeAtPath(const Path &path)
Returns the node at an exact path, or null when no node is there.
Definition Network.cpp:26
Node & createNode(NodeId nodeId, const NodeType &nodeType, const Path &path)
Builds a node, stores it, and opens the child scope its type declares.
Definition Network.cpp:43
std::vector< NodeId > getChildNodeIds(const Path &scope)
Returns the ids of the nodes living directly inside a scope, in no particular order.
Definition Network.cpp:35
void clear()
Empties the network back to a bare root scope.
Definition Network.cpp:77
bool isValidNode(NodeId nodeId) const
Returns whether a node with the given id is present.
Definition Network.cpp:20
NetworkGraph & graph()
Returns the wiring and dependencies between the nodes.
Definition Network.h:103
NodeId reserveNodeId()
Returns an id no node has used yet.
Definition Network.h:74
Node & getNode(NodeId nodeId)
Returns the node with the given id.
Definition Network.cpp:7
std::weak_ptr< prm::NodeParameter > findParameter(const NetworkPath &path, NodeId fromNode=nullNode)
Resolves a parameter reference to its parameter.
Definition Network.cpp:102
Node * findNode(const NetworkPath &path, NodeId fromNode=nullNode)
Resolves a node reference to its node.
Definition Network.cpp:88
Scope * getScope(const Path &path)
Returns the scope at a path, or null when no scope sits there.
Definition Network.cpp:64
auto nodes()
Returns an iterable range over every node, yielding {NodeId, Node&} pairs.
Definition Network.h:43
The unique runtime representation of a node.
Definition Node.h:18
One place nodes live, either the root or the inside of a node that holds one.
Definition Scope.h:26
Everything every node of one kind shares.
Definition NodeType.h:39