#pragma once #include "kernel32/internal.h" #include "kernel32/minwinbase.h" #include namespace wibo { class AsyncIOBackend { public: virtual ~AsyncIOBackend() = default; virtual bool init() = 0; virtual void shutdown() = 0; [[nodiscard]] virtual bool running() const noexcept = 0; virtual bool queueRead(Pin file, OVERLAPPED *ov, void *buffer, DWORD length, const std::optional &offset, bool isPipe) = 0; virtual bool queueWrite(Pin file, OVERLAPPED *ov, const void *buffer, DWORD length, const std::optional &offset, bool isPipe) = 0; }; namespace detail { #if WIBO_ENABLE_LIBURING std::unique_ptr createIoUringBackend(); #endif std::unique_ptr createEpollBackend(); } // namespace detail AsyncIOBackend &asyncIO(); } // namespace wibo