SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::AsyncIOQueue Class Reference

A queue of completed asynchronous I/O tasks. More...

Inheritance diagram for SDL::AsyncIOQueue:
Inheritance graph
[legend]

Public Member Functions

constexpr AsyncIOQueue (const AsyncIOQueueRaw resource)
 Constructs from AsyncIOQueueParam. More...
 
constexpr AsyncIOQueue (const AsyncIOQueue &other)=delete
 Copy constructor.
 
constexpr AsyncIOQueue (AsyncIOQueue &&other)
 Move constructor.
 
constexpr AsyncIOQueue (const AsyncIOQueueRef &other)=delete
 
constexpr AsyncIOQueue (AsyncIOQueueRef &&other)=delete
 
 AsyncIOQueue ()
 Create a task queue for tracking multiple I/O operations. More...
 
 ~AsyncIOQueue ()
 Destructor.
 
AsyncIOQueueoperator= (AsyncIOQueue other)
 Assignment operator.
 
constexpr AsyncIOQueueRaw get () const
 Retrieves underlying AsyncIOQueueRaw.
 
constexpr AsyncIOQueueRaw release ()
 Retrieves underlying AsyncIOQueueRaw and clear this.
 
constexpr auto operator<=> (const AsyncIOQueue &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator AsyncIOQueueParam () const
 Converts to AsyncIOQueueParam.
 
void Destroy ()
 Destroy a previously-created async I/O task queue. More...
 
std::optional< AsyncIOOutcomeGetResult ()
 Query an async I/O task queue for completed tasks. More...
 
std::optional< AsyncIOOutcomeWaitResult (Milliseconds timeout)
 Block until an async I/O task queue has a completed task. More...
 
std::optional< AsyncIOOutcomeWaitResult ()
 Block until an async I/O task queue has a completed task. More...
 
void Signal ()
 Wake up any threads that are blocking in AsyncIOQueue.WaitResult(). More...
 

Detailed Description

When starting an asynchronous operation, you specify a queue for the new task. A queue can be asked later if any tasks in it have completed, allowing an app to manage multiple pending tasks in one place, in whatever order they complete.

Since
This struct is available since SDL 3.2.0.
See also
AsyncIOQueue.AsyncIOQueue
AsyncIO.Read
AsyncIO.Write
AsyncIOQueue.GetResult
AsyncIOQueue.WaitResult
Category:
Resource

Constructor & Destructor Documentation

◆ AsyncIOQueue() [1/2]

constexpr SDL::AsyncIOQueue::AsyncIOQueue ( const AsyncIOQueueRaw  resource)
inlineexplicitconstexpr
Parameters
resourcea AsyncIOQueueRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.

◆ AsyncIOQueue() [2/2]

SDL::AsyncIOQueue::AsyncIOQueue ( )
inline

Async I/O operations are assigned to a queue when started. The queue can be checked for completed tasks thereafter.

Postcondition
a new task queue object or nullptr if there was an error; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
AsyncIOQueue.Destroy
AsyncIOQueue.GetResult
AsyncIOQueue.WaitResult

The documentation for this class was generated from the following file: