예제 #1
0
        private LiveVariable PullLiveVariableUpToNextHigherDiagram(LiveVariable liveVariable)
        {
            Tunnel   outputTunnel   = liveVariable.Terminal.ParentDiagram.ParentStructure.CreateTunnel(Direction.Output, TunnelMode.LastValue, PFTypes.Void, PFTypes.Void);
            Terminal inputTerminal  = outputTunnel.InputTerminals[0],
                     outputTerminal = outputTunnel.OutputTerminals[0];

            CreateNodeFacadesTransform.CreateTunnelNodeFacade(outputTunnel);

            Wire.Create(liveVariable.Terminal.ParentDiagram, liveVariable.Terminal, inputTerminal);
            inputTerminal.GetFacadeVariable().MergeInto(liveVariable.Variable);
            _lifetimeVariableAssociation.MarkVariableConsumed(liveVariable.Variable);

            return(new LiveVariable(outputTerminal.GetFacadeVariable(), outputTerminal));
        }
        private LiveVariable PullLiveVariableUpToNextHigherDiagram(LiveVariable liveVariable)
        {
            Tunnel   outputTunnel   = liveVariable.Terminal.ParentDiagram.ParentStructure.CreateTunnel(Direction.Output, TunnelMode.LastValue, NITypes.Void, NITypes.Void);
            Terminal inputTerminal  = outputTunnel.InputTerminals[0],
                     outputTerminal = outputTunnel.OutputTerminals[0];

            CreateNodeFacadesTransform.CreateTunnelNodeFacade(outputTunnel);

            Wire.Create(liveVariable.Terminal.ParentDiagram, liveVariable.Terminal, inputTerminal);
            AutoBorrowNodeFacade.GetNodeFacade(outputTunnel)[inputTerminal].UnifyWithConnectedWireTypeAsNodeInput(
                liveVariable.Variable,
                new TerminalTypeUnificationResults());
            _lifetimeVariableAssociation.MarkVariableConsumed(liveVariable.Variable);

            return(new LiveVariable(outputTerminal.GetFacadeVariable(), outputTerminal));
        }