Enzo
Loading...
Searching...
No Matches
enzo::nt::NodeManifest Class Reference

The in memory form of one node's manifest file. More...

#include <NodeManifest.h>

Public Member Functions

const NodeType & getNodeType () const
 Returns the node type this manifest describes, with no constructor or folder filled in yet.
 
const NodeImplementation & getImplementation () const
 
const std::map< std::string, std::vector< std::string > > & getParameterValues () const
 Returns the parameter values an alias sets, as written in the manifest.
 
NodeAlias getNodeAlias (const NodeType &aliasedType) const
 Returns the alias this manifest describes.
 

Static Public Member Functions

static NodeManifest loadFromString (const std::string &yaml)
 Returns the manifest described by a yaml document.
 
static NodeManifest loadFromFile (const std::filesystem::path &path)
 Returns the manifest described by a node.yaml file.
 

Detailed Description

The in memory form of one node's manifest file.

A node folder holds a node.yaml declaring the label, tags, input and output counts, parameters, and implementation of the node. This class is that file read into memory.

Example

const NodeManifest manifest = NodeManifest::loadFromFile("nodes/sweep/node.yaml");
manifest.getNodeType().getLabel(); // "Sweep"
std::get<CppImplementation>(manifest.getImplementation()).constructor; // "sweep"
The in memory form of one node's manifest file.
Definition NodeManifest.h:50
static NodeManifest loadFromFile(const std::filesystem::path &path)
Returns the manifest described by a node.yaml file.
Definition NodeManifest.cpp:471
Note
Nothing here touches the surrounding folder, which is what lets tests build a node from a string. Scanning directories and resolving the icon and the library against them is the loader's job.

Member Function Documentation

◆ getNodeAlias()

NodeAlias enzo::nt::NodeManifest::getNodeAlias ( const NodeType & aliasedType) const

Returns the alias this manifest describes.

Exceptions
std::runtime_errorwhen a value does not fit a parameter of the aliased type.
Parameters
aliasedTypeThe node type the alias stands in for, whose parameters give each value its type.

◆ getParameterValues()

const std::map< std::string, std::vector< std::string > > & enzo::nt::NodeManifest::getParameterValues ( ) const
inline

Returns the parameter values an alias sets, as written in the manifest.

offset: [0, 1, 0] gives {"offset", {"0", "1", "0"}}.

◆ loadFromFile()

NodeManifest enzo::nt::NodeManifest::loadFromFile ( const std::filesystem::path & path)
static

Returns the manifest described by a node.yaml file.

Exceptions
std::runtime_errorwhen the file is missing or malformed.

◆ loadFromString()

NodeManifest enzo::nt::NodeManifest::loadFromString ( const std::string & yaml)
static

Returns the manifest described by a yaml document.

Exceptions
std::runtime_errorwhen the document is malformed.

The documentation for this class was generated from the following files: