You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
48 lines
839 B
C++
48 lines
839 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AsioIoable.h"
|
|
|
|
namespace UE {
|
|
namespace Trace {
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
bool FAsioIoable::SetSink(FAsioIoSink* Ptr, uint32 Id)
|
|
{
|
|
if (SinkPtr != nullptr)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
SinkPtr = Ptr;
|
|
SinkId = Id;
|
|
return true;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
void FAsioIoable::OnIoComplete(const asio::error_code& ErrorCode, int32 Size)
|
|
{
|
|
if (SinkPtr == nullptr)
|
|
{
|
|
return;
|
|
}
|
|
|
|
#if defined(UE_BUILD_DEBUG) && 0
|
|
std::string ErrorMessage;
|
|
{
|
|
ErrorMessage = ErrorCode.message();
|
|
}
|
|
#endif
|
|
|
|
if (ErrorCode)
|
|
{
|
|
Size = 0 - ErrorCode.value();
|
|
}
|
|
|
|
FAsioIoSink* Ptr = SinkPtr;
|
|
SinkPtr = nullptr;
|
|
Ptr->OnIoComplete(SinkId, Size);
|
|
}
|
|
|
|
} // namespace Trace
|
|
} // namespace UE
|