/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: IPCPipe.hpp Date: 2022-4-14 Author: Reece ***/ #pragma once namespace Aurora::IPC { struct IPCPipe : IExportableIPC { /** * @brief A loopsource indicating whether or not the pipe has an established client * @return */ virtual AuSPtr AsReadChannelIsOpen() = 0; /** * @brief A UNIX loopsource indicating when the pipe has data available. * Wait semantics will be simlulated on Windows with a constant-step timer. * @return * @warning unimplemented on windows. IsSignaled()-as-has-data works nonblocking, though. */ virtual AuSPtr AsReadChannelHasData() = 0; /** * @brief Returns a shared async file interface to a session between the server * Undefined behaviour is expected while AsReadChannelIsOpen()->IsSignaled() is false. * @return */ virtual AuSPtr NewAsyncTransaction() = 0; /** * @brief Reads at least write.length from the outbound stream of the opposite end * @param nonblocking Wait for data * @return */ virtual bool Read (const Memory::MemoryViewStreamWrite &write, bool nonblocking) = 0; /** * @brief Writes at least write.length to the stream on the opposite end * @param nonblocking Wait for data * @return */ virtual bool Write(const Memory::MemoryViewStreamRead &read) = 0; }; /** * @brief Creates a new exclusive IPC pipe * @return */ AUKN_SYM AuSPtr NewPipe(); /** * @brief Opens an exclusive IPC pipe as the client end given a ... * @param handleString * @return */ AUKN_SYM AuSPtr ImportPipe(const AuString &handleString); }