AuroraRuntime/Source/IO/IPC/AuIPCPipeWriter.cpp

54 lines
1.1 KiB
C++

/***
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuIPCPipeWriter.cpp
Date: 2023-10-21
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "IPC.hpp"
#include "AuIPCHandle.hpp"
#include "AuIPCPipeWriter.hpp"
namespace Aurora::IO::IPC
{
IPCPipeWriter::IPCPipeWriter(IPCPipe *pPipe) :
pParent(pPipe)
{
}
EStreamError IPCPipeWriter::IsOpen()
{
auto pOpenChannel = this->pParent->AsReadChannelIsOpen();
if (!pOpenChannel &&
pOpenChannel->IsSignaled())
{
return EStreamError::eErrorNone;
}
return EStreamError::eErrorStreamNotOpen;
}
EStreamError IPCPipeWriter::Write(const Memory::MemoryViewStreamRead &parameters)
{
parameters.outVariable = 0;
if (this->pParent->Write(parameters))
{
return EStreamError::eErrorNone;
}
return EStreamError::eErrorStreamInterrupted;
}
void IPCPipeWriter::Flush()
{
}
void IPCPipeWriter::Close()
{
}
}