void FWorkerConnection::Disconnect() { UE_LOG(LogSpatialOS, Log, TEXT("Disconnecting")); if (Connection.IsValid()) { ProcessOps(); Connection.Reset(); } }
void CSlotConnect::Process(eConnSrcDst eSrc, long SrcI, eConnSrcDst eDst, long SrcDstI, CFullValue & SrcValue, int Direction) { // Always Executed as a SET - Hence the use of the ReflectedGets if (!m_bValid) return; if (eDst==eCSD_Default) eDst = m_eDst; switch (eDst) { case eCSD_Slot: { CFullValue V=SrcValue; ProcessOps(V); if (m_eSrc==eCSD_Link) ApplyRangeLink2Slot(*Slots[m_lDstIndex], V); gs_SlotMngr.AppendChange(eSrc, SrcI, eCSD_Slot, m_lDstIndex, -1, V, &m_Delay, false, !m_bConnect1Done); break; } case eCSD_CdBlk: { if (m_Delay.Configured()) { CFullValue V=SrcValue; gs_SlotMngr.AppendChange(eSrc, SrcI, eCSD_SlotConn, SrcDstI, -1, V, &m_Delay, false, !m_bConnect1Done); break; } // FALL THROUGH } case eCSD_SlotConn: { CFullValue V=SrcValue; ProcessOps(V); if (m_bCdBlkVarFlt) { V.ChangeType(VT_R8); m_pCdBlkVar->set(V.m_vValue.dblVal); } else { V.ChangeType(VT_I4); m_pCdBlkVar->set(V.m_vValue.lVal); } // Execute pgm CGExecContext ECtx(NULL); m_pCdBlk->m_Code.Execute(ECtx); // Update Destination Tags for (int i=0; i<m_pCdBlk->m_ReflectedGets.GetSize(); i++) { CSlotConnect &C=(*m_pCdBlk->m_ReflectedGets[i]); if (C.m_bCdBlkVarFlt) { CFullValue D=V; D.m_vValue=C.m_pCdBlkVar->getD(); C.ProcessOps(D); gs_SlotMngr.AppendChange(eCSD_CdBlk, C.m_lSrcIndex, C.m_eDst, C.m_lDstIndex, -1, D, &C.m_Delay, false, !m_bConnect1Done); } else { CFullValue L=V; L.m_vValue=C.m_pCdBlkVar->getL(); C.ProcessOps(L); gs_SlotMngr.AppendChange(eCSD_CdBlk, C.m_lSrcIndex, C.m_eDst, C.m_lDstIndex, -1, L, &C.m_Delay, false, !m_bConnect1Done); } } break; } case eCSD_Link: { CFullValue V=SrcValue; if (m_eSrc==eCSD_Slot) ApplyRangeSlot2Link(*Slots[m_lSrcIndex], V); ProcessOps(V); gs_SlotMngr.AppendChange(eSrc, m_lSrcIndex, eDst, m_lDstIndex, -1, V, &m_Delay, false, !m_bConnect1Done); break; } default: ReportError("CSlotConnect::Process", 0, "Invalid Destination %s ", SrcDstString(eDst)); } m_bConnect1Done=true; }