cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AsyncTaskPool Class Reference

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 AsyncTaskPoolgetInstance ()
 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 AsyncTaskPools_asyncTaskPool
var s_asyncTaskPool
local s_asyncTaskPool

Detailed Description

This class allows to perform background operations without having to manipulate threads.

Member Typedef Documentation

typedef std::function<void(void*)>
TaskCallBack
local TaskCallBack

Constructor & Destructor Documentation

var ~AsyncTaskPool ( )
local ~AsyncTaskPool ( )

Member Function Documentation

static void destoryInstance ( )
static

Destroys the async task pool.

var destoryInstance ( )
static

Destroys the async task pool.

local destoryInstance ( )
static

Destroys the async task pool.

static AsyncTaskPool* getInstance ( )
static

Returns the shared instance of the async task pool.

var getInstance ( )
static

Returns the shared instance of the async task pool.

local getInstance ( )
static

Returns the shared instance of the async task pool.

Member Data Documentation

ThreadTasks _threadTasks[int(TaskType::TASK_MAX_TYPE)]
protected
ThreadTasks _threadTasks[int(TaskType::TASK_MAX_TYPE)]
protected
ThreadTasks _threadTasks[int(TaskType::TASK_MAX_TYPE)]
protected
AsyncTaskPool* s_asyncTaskPool
staticprotected
var s_asyncTaskPool
staticprotected
local s_asyncTaskPool
staticprotected

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