Sane C++ Libraries
C++ Platform Abstraction Libraries
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< AsyncSocketAccept, CompletionData > SC::AsyncResultOf< AsyncSocketReceive, CompletionData > SC::AsyncResultOf< T, C > SC::AsyncFileRead::Result SC::AsyncFileWrite::Result SC::AsyncProcessExit::Result SC::AsyncSocketAccept::Result SC::AsyncSocketReceive::Result

Public Member Functions

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

Public Attributes

AsyncRequestasync
 

Protected Attributes

bool shouldBeReactivated = false
 
bool shouldCallCallback = true
 
SC::Result returnCode = SC::Result(true)
 

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() [1/2]

SC::AsyncResult::AsyncResult ( AsyncRequest request,
SC::Result &&  res 
)
inline

Constructs an async result from a request and a result.

◆ AsyncResult() [2/2]

SC::AsyncResult::AsyncResult ( AsyncRequest request)
inline

Constructs an async result from a request.

Member Function Documentation

◆ isValid()

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

Check if the returnCode of this result is valid.

◆ reactivateRequest()

void SC::AsyncResult::reactivateRequest ( bool  value)
inline

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

Parameters
valuetrue will reactivate the request

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