/// <summary> /// Sets up forwarding of the given output port to another output port on a different (sub) node. /// </summary> public void ForwardOutput <TDefinition, TForwardedDefinition, TMsg>(MessageOutput <TDefinition, TMsg> origin, NodeHandle <TForwardedDefinition> replacedNode, MessageOutput <TForwardedDefinition, TMsg> replacement) where TDefinition : NodeDefinition, new() where TForwardedDefinition : NodeDefinition { CommonChecks <TDefinition>(replacedNode, (OutputPortID)origin); GetForwardingBuffer().Add(ForwardedPort.Unchecked.Output(origin.Port, replacedNode, replacement.Port)); }
/// <summary> /// See <see cref="Disconnect(NodeHandle, OutputPortID, NodeHandle, InputPortID)"/> /// </summary> public void Disconnect <TMsg, TSource, TDestination>( NodeHandle <TSource> sourceHandle, MessageOutput <TSource, TMsg> sourcePort, NodeHandle <TDestination> destHandle, MessageInput <TDestination, TMsg> destPort ) where TSource : NodeDefinition where TDestination : NodeDefinition, IMsgHandler <TMsg> { Disconnect(new OutputPair(this, sourceHandle, sourcePort.Port), new InputPair(this, destHandle, new InputPortArrayID(destPort.Port))); }
/// <summary> /// See <see cref="Connect(NodeHandle, OutputPortID, NodeHandle, InputPortID, ConnectionType)"/> /// </summary> public void Connect <TMsg, TSource, TDestination>( NodeHandle <TSource> sourceHandle, MessageOutput <TSource, TMsg> sourcePort, NodeHandle <TDestination> destHandle, MessageInput <TDestination, TMsg> destPort ) where TSource : NodeDefinition where TDestination : NodeDefinition, IMsgHandler <TMsg> { Connect((PortDescription.Category.Message, typeof(TMsg), ConnectionType.Normal), new OutputPair(this, sourceHandle, sourcePort.Port), new InputPair(this, destHandle, new InputPortArrayID(destPort.Port))); }
public void Disconnect <TTask, TMsg, TSource, TDestination>( NodeHandle <TSource> sourceHandle, MessageOutput <TSource, TMsg> sourcePort, NodeInterfaceLink <TTask, TDestination> destHandle ) where TSource : NodeDefinition where TTask : ITaskPort <TTask> where TDestination : NodeDefinition, TTask, IMsgHandler <TMsg>, new() { Disconnect(sourceHandle, sourcePort.Port, destHandle, GetDefinition(destHandle.TypedHandle).GetPort(destHandle)); }
/// <summary> /// Emit a message from yourself on a port. Everything connected to it /// will receive your message. /// </summary> /// public void EmitMessage <T, TNodeDefinition>(MessageOutput <TNodeDefinition, T> port, in T msg)