#include <nodetemplate.h>
A node template allows to create node system instantiations based on a set of template parameters.
Public Member Functions | |
MAXON_METHOD Result< Bool > | Supports (const NodeSystemClass &cls) const |
MAXON_METHOD Result< NodeSystem > | Instantiate (const InstantiationTrace &parent, const TemplateArguments &args=GetZeroRef< TemplateArguments >()) const |
MAXON_FUNCTION Result< NodeSystem > | Instantiate (const InstantiationTrace &parent, Result< TemplateArguments > &&args) const |
MAXON_FUNCTION Result< NodeSystem > | Instantiate (const NodeSystemClass &cls, const AssetRepositoryRef &repo, const TemplateArguments &args=GetZeroRef< TemplateArguments >()) const |
MAXON_METHOD Result< Bool > | PrivateGetConfigurations (const ValueReceiver< const TemplateArguments & > &receiver) const |
MAXON_METHOD Result< Bool > | SupportsImpl (const NodeSystemClass &cls) const |
MAXON_METHOD Result< NodeSystem > | InstantiateImpl (const InstantiationTrace &parent, const TemplateArguments &args) const |
MAXON_METHOD Bool | IsGroupBase () const |
MAXON_FUNCTION Bool | IsGroup () const |
MAXON_ATTRIBUTE_CLASS (Array< IdAndVersion >, Bases, "net.maxon.node.bases") | |
MAXON_FUNCTION Result< NodeSystem > | Instantiate (const NodeSystemClass &cls, const AssetRepositoryRef &repo, const DataDictionary &additionalContext, const TemplateArguments &args=GetZeroRef< TemplateArguments >()) const |
Private Member Functions | |
MAXON_INTERFACE (NodeTemplateInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.node.interface.nodetemplate", MAXON_IMPLEMENTATION_MODULE("net.maxon.nodes")) | |
|
private |
MAXON_METHOD Result<Bool> Supports | ( | const NodeSystemClass & | cls | ) | const |
Checks if this node template can be instantiated for the node system class cls. If true is returned, this does not necessarily mean that all possible instantiations of the template are supported, but at least some.
The default implementation of this method just forwards to NodeSystemClass::SupportsImpl. {You must not override it.}
[in] | cls | The node system class to check. |
MAXON_METHOD Result<NodeSystem> Instantiate | ( | const InstantiationTrace & | parent, |
const TemplateArguments & | args = GetZeroRef< TemplateArguments >() |
||
) | const |
Instantiates this template using the given template arguments in the context of #parent.
If this template or the node system class support the instantiation in general but not for the given arguments, a NodeSystem will be returned nevertheless but with error attributes indicating the instantiation error. If the instantiation isn't supported at all, error attributes can be set too, or an error can be returned.
The implementation of this method just forwards to NodeSystemClass::InstantiateImpl. {You must not override it.}
[in] | parent | The parent instantiation context, this defines the node system class to use as well as the asset repository for asset resolution. |
[in] | args | Arguments to parametrize the instantiation. |
MAXON_FUNCTION Result<NodeSystem> Instantiate | ( | const InstantiationTrace & | parent, |
Result< TemplateArguments > && | args | ||
) | const |
Instantiates this template using the given template arguments in the context of #parent.
If this template or the node system class support the instantiation in general but not for the given arguments, a NodeSystem will be returned nevertheless but with error attributes indicating the instantiation error. If the instantiation isn't supported at all, error attributes can be set too, or an error can be returned.
The implementation of this method just forwards to NodeSystemClass::InstantiateImpl. {You must not override it.}
[in] | parent | The parent instantiation context, this defines the node system class to use as well as the asset repository for asset resolution. |
[in] | args | Arguments to parametrize the instantiation. |
MAXON_FUNCTION Result<NodeSystem> Instantiate | ( | const NodeSystemClass & | cls, |
const AssetRepositoryRef & | repo, | ||
const TemplateArguments & | args = GetZeroRef< TemplateArguments >() |
||
) | const |
Instantiates this template using the given template arguments for the node system class cls. Asset references are resolved in the scope of the asset repository #repo.
If this template or the node system class support the instantiation in general but not for the given arguments, a NodeSystem will be returned nevertheless but with error attributes indicating the instantiation error. If the instantiation isn't supported at all, error attributes can be set too, or an error can be returned.
The implementation of this function just forwards to NodeSystemClass::InstantiateImpl.
[in] | cls | The node system class to use for the instantiation. |
[in] | repo | The asset repository to use for asset resolution. |
[in] | args | Arguments to parametrize the instantiation. |
MAXON_METHOD Result<Bool> PrivateGetConfigurations | ( | const ValueReceiver< const TemplateArguments & > & | receiver | ) | const |
Yields all possible template parameter configurations for this template. Templates can implement this method if they have a finite number of instantiations.
[in] | receiver | A callback which receives the configurations. |
MAXON_METHOD Result<Bool> SupportsImpl | ( | const NodeSystemClass & | cls | ) | const |
Checks if this node template can be instantiated for the node system class cls. If true is returned, this does not necessarily mean that all possible instantiations of the template are supported, but at least some.
This method shouldn't be invoked directly, use Supports instead. You have to implement this method to define a template-specific check, it will be called by NodeSystemClass::SupportsImpl.
[in] | cls | The node system class to check. |
MAXON_METHOD Result<NodeSystem> InstantiateImpl | ( | const InstantiationTrace & | parent, |
const TemplateArguments & | args | ||
) | const |
Instantiates this template using the given arguments.
This method shouldn't be invoked directly, use Instantiate instead. You have to implement this method to define the template instantiation, it will be called by NodeSystemClass::InstantiateImpl.
[in] | parent | The parent instantiation context. You can reach all enclosing instantiation contexts through parent, this helps to prevent infinite recursions. |
[in] | args | Arguments to parametrize the instantiation. |
MAXON_METHOD Bool IsGroupBase | ( | ) | const |
@MAXON_ANNOTATION{methodId="IsGroupBase@12e73654e6d65520"->"IsGroup@12e73654e6d65520"}
Tells if this node template is a group base. Group bases may have some ports but are otherwise empty or have internal nodes only (e.g. the loop carried value template). When a group base is added in the node editor it isn't added directly but as an editable instance of the group base.
MAXON_FUNCTION Bool IsGroup | ( | ) | const |
MAXON_ATTRIBUTE_CLASS | ( | Array< IdAndVersion > | , |
Bases | , | ||
"net.maxon.node.bases" | |||
) |
MAXON_FUNCTION Result<NodeSystem> Instantiate | ( | const NodeSystemClass & | cls, |
const AssetRepositoryRef & | repo, | ||
const DataDictionary & | additionalContext, | ||
const TemplateArguments & | args = GetZeroRef< TemplateArguments >() |
||
) | const |
Instantiates this template using the given template arguments for the node system class cls. Asset references are resolved in the scope of the asset repository #repo.
If this template or the node system class support the instantiation in general but not for the given arguments, a NodeSystem will be returned nevertheless but with error attributes indicating the instantiation error. If the instantiation isn't supported at all, error attributes can be set too, or an error can be returned.
The implementation of this function just forwards to NodeSystemClass::InstantiateImpl.
[in] | cls | The node system class to use for the instantiation. |
[in] | repo | The asset repository to use for asset resolution. |
[in] | args | Arguments to parametrize the instantiation. |
[in] | additionalContext | Supplementary instantiation context parameters. |