You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Abstract out platform specific implementation details into ComputePlatform.cpp/h. - Add an overridable transport implementation of ComputeSocket, similar to what is available in C#. - Add some local tests for C++ implementation. - Various refactoring to converge implementation details/names/etc... [CL 26535754 by Ben Marsh in ue5-main branch]
41 lines
767 B
C++
41 lines
767 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ComputeChannel.h"
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include "ComputeSocket.h"
|
|
|
|
FComputeChannel::FComputeChannel()
|
|
{
|
|
}
|
|
|
|
FComputeChannel::FComputeChannel(FComputeBufferReader InReader, FComputeBufferWriter InWriter)
|
|
: Reader(std::move(InReader))
|
|
, Writer(std::move(InWriter))
|
|
{
|
|
}
|
|
|
|
FComputeChannel::~FComputeChannel()
|
|
{
|
|
}
|
|
|
|
bool FComputeChannel::IsValid() const
|
|
{
|
|
return Reader.IsValid();
|
|
}
|
|
|
|
size_t FComputeChannel::Send(const void* Data, size_t Size, int TimeoutMs)
|
|
{
|
|
return Writer.Write(Data, Size, TimeoutMs);
|
|
}
|
|
|
|
size_t FComputeChannel::Recv(void* Data, size_t Size, int TimeoutMs)
|
|
{
|
|
return Reader.Read(Data, Size, TimeoutMs);
|
|
}
|
|
|
|
void FComputeChannel::MarkComplete()
|
|
{
|
|
Writer.MarkComplete();
|
|
}
|