Enzo
Loading...
Searching...
No Matches
NodeManifest.h
1#pragma once
2#include "Engine/Network/NodeAlias.h"
3#include "Engine/Network/NodeType.h"
4#include <filesystem>
5#include <map>
6#include <string>
7#include <variant>
8#include <vector>
9
10namespace enzo::nt {
11
14{
15 std::string library;
16 std::string constructor;
17};
18
21{
24 std::string aliasedType;
25};
26
28using NodeImplementation = std::variant<CppImplementation, AliasImplementation>;
29
50{
51 public:
54 static NodeManifest loadFromString(const std::string& yaml);
55
58 static NodeManifest loadFromFile(const std::filesystem::path& path);
59
62 const NodeType& getNodeType() const { return nodeType_; }
63 const NodeImplementation& getImplementation() const { return implementation_; }
64
70 const std::map<std::string, std::vector<std::string>>& getParameterValues() const
71 {
72 return parameterValues_;
73 }
74
83 NodeAlias getNodeAlias(const NodeType& aliasedType) const;
84
85 private:
86 NodeType nodeType_;
87 NodeImplementation implementation_;
88 std::map<std::string, std::vector<std::string>> parameterValues_;
89};
90
91} // namespace enzo::nt
The in memory form of one node's manifest file.
Definition NodeManifest.h:50
static NodeManifest loadFromString(const std::string &yaml)
Returns the manifest described by a yaml document.
Definition NodeManifest.cpp:395
static NodeManifest loadFromFile(const std::filesystem::path &path)
Returns the manifest described by a node.yaml file.
Definition NodeManifest.cpp:471
const std::map< std::string, std::vector< std::string > > & getParameterValues() const
Returns the parameter values an alias sets, as written in the manifest.
Definition NodeManifest.h:70
NodeAlias getNodeAlias(const NodeType &aliasedType) const
Returns the alias this manifest describes.
Definition NodeManifest.cpp:431
const NodeType & getNodeType() const
Returns the node type this manifest describes, with no constructor or folder filled in yet.
Definition NodeManifest.h:62
The node type an alias creates in its place.
Definition NodeManifest.h:21
std::string aliasedType
The full name of the node type the alias stands in for, such as "enzo::attributeNoise".
Definition NodeManifest.h:24
The constructor a shared library exports to give a node its behaviour.
Definition NodeManifest.h:14
A tab menu entry that creates a node of another type with its own starting values.
Definition NodeAlias.h:18
Everything every node of one kind shares.
Definition NodeType.h:40