Files
UnrealEngineUWP/Engine/Source/Programs/Horde/Samples/RemoteWorkerCpp/ComputeChannel.h
Ben Marsh 1f60ee0824 Horde: Unifying C#/C++ implementations of remote execution API.
- 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]
2023-07-22 14:17:04 -04:00

37 lines
835 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ComputeBuffer.h"
class FComputeSocket;
//
// Allows bi-directional communication between two nodes using compute buffers
//
class FComputeChannel
{
public:
// Reader for the channel
FComputeBufferReader Reader;
// Writer for the channel
FComputeBufferWriter Writer;
FComputeChannel();
FComputeChannel(FComputeBufferReader InReader, FComputeBufferWriter InWriter);
~FComputeChannel();
// Tests whether the channel is valid
bool IsValid() const;
// Sends bytes to the remote.
size_t Send(const void* Data, size_t Size, int TimeoutMs = -1);
// Reads as many bytes as are available from the socket.
size_t Recv(void* Data, size_t Size, int TimeoutMs = -1);
// Indicate to the remote that no more data will be sent.
void MarkComplete();
};