52 lines
1.0 KiB
C++
52 lines
1.0 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 ¶meters)
|
|
{
|
|
if (this->pParent->Write(parameters))
|
|
{
|
|
return EStreamError::eErrorNone;
|
|
}
|
|
|
|
return EStreamError::eErrorStreamInterrupted;
|
|
}
|
|
|
|
void IPCPipeWriter::Flush()
|
|
{
|
|
|
|
}
|
|
|
|
void IPCPipeWriter::Close()
|
|
{
|
|
|
|
}
|
|
} |