Skip to content

Node

class Node

Base class for Amplimix pipeline nodes.

This class presents the basic structure to create Amplimix pipeline nodes. Each Node of your pipelines must be derived from this class and implement the CreateInstance() and DestroyInstance() methods.

See
NodeInstance

Variables

Name Description
m_name The name of this node.

Functions

Name Description
Node Node constructor.
~Node Node destructor.
CreateInstance Creates a new instance of the node.
DestroyInstance Destroys the specified instance of the node.
GetName Returns the name of the node.
Register Registers a new node.
Unregister Unregisters a node.
Construct Creates a new instance of the the node with the given name * and returns its pointer. The returned pointer should be deleted using Node::Destruct().
Destruct Destroys the given node instance.
LockRegistry Locks the nodes registry.
UnlockRegistry Unlocks the nodes registry.

Variable Details

m_name

AmString m_name

The name of this node.

Function Details

Construct

static NodeInstance* Construct(const AmString& name)

Creates a new instance of the the node with the given name * and returns its pointer. The returned pointer should be deleted using Node::Destruct().

Parameter name
The name of the node.
Return
The node with the given name, or nullptr if none.

CreateInstance

* CreateInstance() const

Creates a new instance of the node.

Parameter id
Unique identifier for the new instance.
Parameter layer
The Amplimix layer associated with the new instance.
Parameter pipeline
The pipeline associated with the new instance.
Return
A new instance of the node.

DestroyInstance

virtual void DestroyInstance(NodeInstance* instance) const = 0

Destroys the specified instance of the node.

Parameter instance
Pointer to the instance to be destroyed.

Destruct

static void Destruct(const AmString& name, NodeInstance* instance)

Destroys the given node instance.

Parameter name
The name of the node.
Parameter instance
The node instance to destroy.

GetName

[[nodiscard]] const AmString& GetName() const

Returns the name of the node.

LockRegistry

static void LockRegistry()

Locks the nodes registry.

Warning

This function is mainly used for internal purposes. It's called before the Engine initialization, to discard the registration of new nodes after the engine is fully loaded.

Node

Node(AmString name)

Node constructor.

Parameter name
Name of the node. Should be unique within the pipeline.

Register

static void Register(Node* node)

Registers a new node.

Parameter node
The node to add in the registry.

UnlockRegistry

static void UnlockRegistry()

Unlocks the nodes registry.

Warning

This function is mainly used for internal purposes. It's called after the Engine deinitialization, to allow the registration of new nodes after the engine is fully unloaded.

Unregister

static void Unregister(const Node* node)

Unregisters a node.

Parameter node
The node to remove from the registry.

~Node

virtual ~Node()

Node destructor.