AuroraRuntime/Include/Aurora/IO/IIOPipeProcessor.hpp
Reece 44108a322e 2/3 of the IO update (very early implementation)
[+] TTYConsole::GetPaddingTopOfLog,GetPaddingHeadOfLog,GetPaddingTopOfLog [+ set variants]
[+] IO::IOYield()
[+] IO::IAsyncTransaction::Failed,GetOSErrorCode()
[+] IByteBufferStreamPair
[+] IIOBufferedInterceptor
[+] IIOBufferedProcessor
[+] IIOEventListener
[+] IIOPipeEventListener
[+] IIOProcessorEventListener
[+] IIOProcessorManualInvoker
[+] IIOWaitableIOLoopSource
[+] IIOWaitableIOTimer
[+] IIOWaitableItem
[+] IIOWaitableTickLimiter
[+] IOAdapterAsyncStream
[+] IOAdapterByteBuffer
[+] IOAdapterCompression
[+] IOAdapterSeeking
[*] Cleanup CpuInfo.Linux.cpp
[*] Fixup async threadpool some more
[*] LSTimer.NT.cpp updates timer object on tick state update, akin to Linux
2022-06-12 00:01:27 +01:00

72 lines
1.7 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IIOPipeProcessor.hpp
Date: 2022-6-6
Author: Reece
***/
#pragma once
namespace Aurora::IO
{
struct IIOPipeInterceptor;
struct IOPipeData
{
AuSPtr<IIOWaitableItem> watchItem;
AuSPtr<IStreamReader> reader;
AuSPtr<IStreamWriter> writer;
};
struct IOPipeRequest
{
/**
* @brief The two streams to join and an invokable object
*/
IOPipeData data;
/**
* @brief Amount of bytes to transfer
*/
AuUInt32 lengthOrZero {};
/**
* @brief event listener
*/
AuSPtr<IIOPipeEventListener> listener;
/**
* @brief Used as the buffer size for streams of length 0
*/
AuUInt32 fallbackPageSize {4096 * 50};
AuSPtr<IIOPipeInterceptor> processor;
};
/**
* @brief Different operating systems implement high level stream copy abstraction between network, file, and/or file descriptors.
* This interface connects arbitrary stream objects to one another by piping data under an iprocessor tick; or delegates
* such task to the operating system, if possible.
*/
struct IIOPipeProcessor
{
/**
* @brief
* @param request
* @return
*/
virtual bool BeginPipe(const IOPipeRequest &request) = 0;
/**
* @brief
* @param itm
*/
virtual void EndByWatch(const AuSPtr<IIOWaitableItem> &itm) = 0;
/**
* @brief
* @param itm
*/
virtual void EndByListener(const AuSPtr<IIOPipeEventListener> &itm) = 0;
};
}