Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::AsyncTask Struct Reference

Holds (reference to) a SC::ThreadPool and SC::ThreadPool::Task to execute an SC::AsyncRequest in a background thread This object lifetime is the same as the SC::AsyncRequest it's associated with, like SC::AsyncFileRead or SC::AsyncFileWrite. More...

#include <Async.h>

Inheritance diagram for SC::AsyncTask:
SC::AsyncTaskOf< AsyncType >

Public Member Functions

 AsyncTask (AsyncCompletionData &asyncCompletionData)
 

Protected Member Functions

void freeTask ()
 
bool isFree () const
 

Protected Attributes

ThreadPoolTask task
 
ThreadPoolthreadPool = nullptr
 
AsyncCompletionDatacompletionData
 
SC::Result returnCode = SC::Result(true)
 
AsyncRequestasync = nullptr
 

Friends

struct AsyncEventLoop
 
struct AsyncRequest
 

Detailed Description

Holds (reference to) a SC::ThreadPool and SC::ThreadPool::Task to execute an SC::AsyncRequest in a background thread This object lifetime is the same as the SC::AsyncRequest it's associated with, like SC::AsyncFileRead or SC::AsyncFileWrite.

Note
Operations that support to be executed in background thread, accept an SC::AsyncTask in their start method.
Warning
The SC::ThreadPool::Task cannot be shared with other requests and it cannot be reused until the completion callback has been called.

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