Class NodeProcessor
Base class for typed node processors with specific input/output types. Provides helper methods for registering ports and managing values.
public abstract class NodeProcessor : INodeProcessor
- Inheritance
-
NodeProcessor
- Implements
- Derived
- Inherited Members
Constructors
NodeProcessor(Node)
Creates a new node processor.
protected NodeProcessor(Node node)
Parameters
nodeNodeThe node this processor is attached to.
Properties
AutoExecute
Gets whether this processor should auto-execute when inputs change.
public virtual bool AutoExecute { get; }
Property Value
InputValues
Gets all input port values.
public IReadOnlyDictionary<string, IPortValue> InputValues { get; }
Property Value
IsValid
Gets whether this processor is currently valid (all required inputs connected).
public virtual bool IsValid { get; }
Property Value
Node
Gets the node this processor is attached to.
public Node Node { get; }
Property Value
OutputValues
Gets all output port values.
public IReadOnlyDictionary<string, IPortValue> OutputValues { get; }
Property Value
Methods
GetInputPort<T>(string)
Gets an input port by ID.
protected ReactivePort<T>? GetInputPort<T>(string portId)
Parameters
portIdstring
Returns
- ReactivePort<T>
Type Parameters
T
GetInput<T>(string)
Gets a typed input value.
protected T? GetInput<T>(string portId)
Parameters
portIdstringThe port identifier.
Returns
- T
The value, or default if not found.
Type Parameters
TThe expected type.
GetOutputPort<T>(string)
Gets an output port by ID.
protected ReactivePort<T>? GetOutputPort<T>(string portId)
Parameters
portIdstring
Returns
- ReactivePort<T>
Type Parameters
T
Process()
Processes inputs and updates outputs. Called automatically when any input changes (if auto-execute is enabled).
public abstract void Process()
RegisterInput<T>(string, T?)
Registers an input port with a reactive value.
protected ReactivePort<T> RegisterInput<T>(string portId, T? initialValue = default)
Parameters
portIdstringThe port identifier (must match a port in Node.Inputs).
initialValueTThe initial value.
Returns
- ReactivePort<T>
The created reactive port.
Type Parameters
TThe type of the port value.
RegisterOutput<T>(string, T?)
Registers an output port with a reactive value.
protected ReactivePort<T> RegisterOutput<T>(string portId, T? initialValue = default)
Parameters
portIdstringThe port identifier (must match a port in Node.Outputs).
initialValueTThe initial value.
Returns
- ReactivePort<T>
The created reactive port.
Type Parameters
TThe type of the port value.
SetOutput<T>(string, T?)
Sets a typed output value.
protected void SetOutput<T>(string portId, T? value)
Parameters
portIdstringThe port identifier.
valueTThe value to set.
Type Parameters
TThe value type.