2023-10-21 09:39:47 +00:00
|
|
|
/***
|
|
|
|
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 ¶meters)
|
|
|
|
{
|
2023-12-28 16:49:11 +00:00
|
|
|
parameters.outVariable = 0;
|
|
|
|
|
2023-10-21 09:39:47 +00:00
|
|
|
if (this->pParent->Write(parameters))
|
|
|
|
{
|
|
|
|
return EStreamError::eErrorNone;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EStreamError::eErrorStreamInterrupted;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IPCPipeWriter::Flush()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void IPCPipeWriter::Close()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|