AuroraRuntime/Include/Aurora/IO/IIOProcessor.hpp
Reece Wilson 70418df761 [+] Added extended IO apis
> StartSimpleLSWatchEx
> StartSimpleIOWatchEx
> StartIOWatchEx
[*] Update README
2022-06-28 16:04:07 +01:00

55 lines
2.9 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IIOProcessor.hpp
Date: 2022-6-6
Author: Reece
***/
#pragma once
namespace Aurora::IO
{
struct IIOProcessor
{
virtual AuUInt32 TryTick () = 0;
virtual AuUInt32 RunTick () = 0;
virtual AuUInt32 TickFor (const AuSPtr<IIOProcessorItem> &ioEvent) = 0;
virtual AuUInt32 ManualTick () = 0;
virtual AuUInt64 SetRefreshRate (AuUInt64 ns) = 0;
virtual bool HasRefreshRate () = 0;
virtual bool MultiplexRefreshRateWithIOEvents() = 0;
virtual AuUInt64 GetOwnedThreadId () = 0;
virtual AuSPtr<IIOProcessorItem> StartIOWatch (const AuSPtr<IIOWaitableItem> &object, const AuSPtr<IIOEventListener> &listener) = 0;
virtual AuSPtr<IIOProcessorItem> StartIOWatchEx (const AuSPtr<IIOWaitableItem> &object, const AuSPtr<IIOEventListener> &listener, bool singleshot) = 0;
virtual AuSPtr<IIOProcessorItem> StartSimpleIOWatch (const AuSPtr<IIOWaitableItem> &object, const AuSPtr<IIOSimpleEventListener> &listener) = 0;
virtual AuSPtr<IIOProcessorItem> StartSimpleIOWatchEx(const AuSPtr<IIOWaitableItem> &object, const AuSPtr<IIOSimpleEventListener> &listener, bool singleshot) = 0;
virtual AuSPtr<IIOProcessorItem> StartSimpleLSWatch (const AuSPtr<Loop::ILoopSource> &source, const AuSPtr<IIOSimpleEventListener> &listener) = 0;
virtual AuSPtr<IIOProcessorItem> StartSimpleLSWatchEx(const AuSPtr<Loop::ILoopSource> &source, const AuSPtr<IIOSimpleEventListener> &listener, bool singleshot, AuUInt32 msTimeout = 0) = 0;
virtual bool SubmitIOWorkItem (const AuSPtr<IIOProcessorWorkUnit> &work) = 0;
// Inter-frame callbacks indicating point of execution throughout the [START](optional [yield])[IO][IO TICK][WORK ITEMS][EPILOGUE][END OF FRAME] frame
virtual bool AddEventListener (const AuSPtr<IIOProcessorEventListener> &eventListener) = 0;
virtual void RemoveEventListener(const AuSPtr<IIOProcessorEventListener> &eventListener) = 0;
virtual AuSPtr<IIOPipeProcessor> ToPipeProcessor () = 0;
// Reference loop queue
virtual AuSPtr<Loop::ILoopQueue> ToQueue () = 0;
virtual void ReleaseAllWatches () = 0;
virtual bool HasItems () = 0;
};
AUKN_SYM AuSPtr<IIOProcessor> NewIOProcessor(bool tickOnly, const AuSPtr<Loop::ILoopQueue> &queue);
AUKN_SYM AuSPtr<IIOProcessor> NewIOProcessorOnThread(bool tickOnly, Async::WorkerPId_t id);
AUKN_SYM AuSPtr<IIOProcessor> NewIOProcessorNoQueue(bool tickOnly);
}