Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::AsyncResult Struct Reference

Base class for all async results (argument of completion callbacks). More...

#include <Async.h>

Inheritance diagram for SC::AsyncResult:
SC::AsyncResultOf< AsyncFileRead, CompletionData > SC::AsyncResultOf< AsyncFileWrite, CompletionData > SC::AsyncResultOf< AsyncProcessExit, CompletionData > SC::AsyncResultOf< AsyncSocketReceive, CompletionData > SC::AsyncResultOf< AsyncSocketAccept, CompletionData > SC::AsyncResultOf< T, C > SC::AsyncFileRead::Result SC::AsyncFileWrite::Result SC::AsyncProcessExit::Result SC::AsyncSocketReceive::Result

Public Member Functions

 AsyncResult (AsyncEventLoop &eventLoop, AsyncRequest &request, SC::Result &res, bool *hasBeenReactivated=nullptr)
 Constructs an async result from a request and a result.
 
void reactivateRequest (bool shouldBeReactivated)
 Ask the event loop to re-activate this request after it was already completed.
 
const SC::ResultisValid () const
 Check if the returnCode of this result is valid.
 

Public Attributes

AsyncEventLoopeventLoop
 
AsyncRequestasync
 

Protected Attributes

bool shouldCallCallback = true
 
bool * hasBeenReactivated = nullptr
 
SC::ResultreturnCode
 

Friends

struct AsyncEventLoop
 

Detailed Description

Base class for all async results (argument of completion callbacks).

It holds Result (returnCode) and re-activation flag.

Constructor & Destructor Documentation

◆ AsyncResult()

SC::AsyncResult::AsyncResult ( AsyncEventLoop & eventLoop,
AsyncRequest & request,
SC::Result & res,
bool * hasBeenReactivated = nullptr )
inline

Constructs an async result from a request and a result.

Member Function Documentation

◆ isValid()

const SC::Result & SC::AsyncResult::isValid ( ) const
inlinenodiscard

Check if the returnCode of this result is valid.

◆ reactivateRequest()

void SC::AsyncResult::reactivateRequest ( bool shouldBeReactivated)

Ask the event loop to re-activate this request after it was already completed.

Parameters
shouldBeReactivatedtrue will reactivate the request

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