AuroraRuntime/Include/Aurora/IO/IOAdapterAsyncStream.hpp
Reece 7fde7d04fb [+] EPipeCallbackType
[+] IIOBufferedStreamAvailable callback
[+] IIOProcessor singleshot work items / IIOProcessorWorkUnit
[+] IOPipeCallback description of a pipes destination
[+] IOPipeInputData description of a pipes source
[+] IOPipeRequest, IOPipeRequestAIO, IOPipeRequestBasic
[+] IPipeBackend hooks for on start/end hooks of IOPipeRequestBasics
[*] Update IOAdapaterAsyncStream implementation to better support caller buffering
[*] Updated IAsyncStreamReader to include a warm/dequeue API for direct async usage
[*] Fix NT IO regressions
[*] Fix ThreadPool shutdown on an unregistered thread
[*] Fix race condition in Async.NT.cpp & fix signalable state to closely match Linux (dunno how this was passing before)
[*] Refactor IOProcessorWorkUnit -> IIOProcessorWorkUnit
[*] Update experimental header to include the changes
2022-06-21 05:49:36 +01:00

50 lines
1.4 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IOAdapterAsyncStream.hpp
Date: 2022-6-6
Author: Reece
***/
#pragma once
namespace Aurora::IO
{
struct IAsyncStreamReader : IStreamReader
{
/**
* @brief Optional advanced use case.
* Begins work given caller provided memory
* @return
*/
virtual EStreamError BeginRead(const AuSPtr<Memory::MemoryViewWrite> &internalView) = 0;
/**
* @brief Optional advanced use case.
* Dequeues work done by begin read
* @return
*/
virtual EStreamError Dequeue(AuUInt reqLength, Memory::MemoryViewWrite &out) = 0;
};
struct IAsyncStreamAdapater
{
virtual bool SetFlushOnWrite(bool value) = 0;
virtual void ReserveBuffer(AuUInt length) = 0;
virtual AuUInt GetReadOffset() = 0;
virtual AuUInt SetReadOffset(AuUInt offset) = 0;
virtual AuUInt GetWriteOffset() = 0;
virtual AuUInt SetWriteOffset(AuUInt offset) = 0;
virtual AuSPtr<IAsyncStreamReader> ToStreamReader() = 0;
virtual AuSPtr<IStreamWriter> ToStreamWriter() = 0;
virtual AuSPtr<IIOWaitableItem> ToWaitable() = 0;
virtual bool Reset() = 0;
};
AUKN_SYM AuSPtr<IAsyncStreamAdapater> NewAsyncStreamAdapter(const AuSPtr<IAsyncTransaction> &transaction, bool isStream);
}