This class allows to perform background operations without having to manipulate threads. More...
#include <CCAsyncTaskPool.h>
Classes | |
class | ThreadTasks |
Public Types | |
enum | TaskType { TASK_IO, TASK_NETWORK, TASK_OTHER, TASK_MAX_TYPE } |
typedef std::function< void(void *)> | TaskCallBack |
Public Member Functions | |
void | stopTasks (TaskType type) |
Stop tasks. More... | |
var | stopTasks ( var type) |
Stop tasks. More... | |
local | stopTasks ( local type) |
Stop tasks. More... | |
template<class F > | |
void | enqueue (TaskType type, const TaskCallBack &callback, void *callbackParam, F &&f) |
Enqueue a asynchronous task. More... | |
template<class F > | |
var | enqueue ( var type, var callback, var callbackParam, var f) |
Enqueue a asynchronous task. More... | |
template<class F > | |
local | enqueue ( local type, local callback, local callbackParam, local f) |
Enqueue a asynchronous task. More... | |
~AsyncTaskPool () | |
~AsyncTaskPool () | |
~AsyncTaskPool () |
Static Public Member Functions | |
static AsyncTaskPool * | getInstance () |
Returns the shared instance of the async task pool. More... | |
var | getInstance () |
Returns the shared instance of the async task pool. More... | |
local | getInstance () |
Returns the shared instance of the async task pool. More... | |
static void | destoryInstance () |
Destroys the async task pool. More... | |
var | destoryInstance () |
Destroys the async task pool. More... | |
local | destoryInstance () |
Destroys the async task pool. More... | |
Public Attributes | |
CC_CONSTRUCTOR_ACCESS | __pad0__: AsyncTaskPool() |
Protected Attributes | |
ThreadTasks | _threadTasks [int(TaskType::TASK_MAX_TYPE)] |
var | _threadTasks ( var TASK_MAX_TYPE) |
local | _threadTasks ( local TASK_MAX_TYPE) |
Static Protected Attributes | |
static AsyncTaskPool * | s_asyncTaskPool |
var | s_asyncTaskPool |
local | s_asyncTaskPool |
This class allows to perform background operations without having to manipulate threads.
typedef std::function<void(void*)> TaskCallBack |
var TaskCallBack |
local TaskCallBack |
~AsyncTaskPool | ( | ) |
var ~AsyncTaskPool | ( | ) |
local ~AsyncTaskPool | ( | ) |
|
static |
Destroys the async task pool.
|
static |
Destroys the async task pool.
|
static |
Destroys the async task pool.
|
static |
Returns the shared instance of the async task pool.
|
static |
Returns the shared instance of the async task pool.
|
static |
Returns the shared instance of the async task pool.
CC_CONSTRUCTOR_ACCESS __pad0__ |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |