Cocos2d-x  v3.11
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
DataPool< T > Class Template Reference

DataPool is a data pool, used for recycling data. More...

Public Member Functions

T * createData ()
 Allocates a data from unallocated pool. More...
 
void lockLatestData ()
 Push current data into unallocated pool.
 
void lockData (T *data)
 Push the specified data into unallocated pool. More...
 
void lockAllDatas ()
 Push all allocated datas into unallocated pool.
 
T * getFirst ()
 Get the first data of allocated pool. More...
 
T * getNext ()
 Get the next data of allocated pool. More...
 
const PoolList & getActiveDataList () const
 Get the allocated pool. More...
 
var getActiveDataList ()
 Get the allocated pool. More...
 
local getActiveDataList ()
 Get the allocated pool. More...
 
const PoolList & getUnActiveDataList () const
 Get the unallocated pool. More...
 
void addData (T *data)
 add a new data into unallocated pool.
 
bool empty () const
 To determine whether the allocated pool is empty.
 
void removeAllDatas ()
 Remove all datas.
 

Detailed Description

template<typename T>
class cocos2d::DataPool< T >

DataPool is a data pool, used for recycling data.

Member Function Documentation

T* createData ( )
inline

Allocates a data from unallocated pool.

A allocated data.

var createData ( )
inline

Allocates a data from unallocated pool.

A allocated data.

local createData ( )
inline

Allocates a data from unallocated pool.

A allocated data.

void lockData ( T *  data)
inline

Push the specified data into unallocated pool.

The pointer of data.

var lockData ( var  data)
inline

Push the specified data into unallocated pool.

The pointer of data.

local lockData ( local  data)
inline

Push the specified data into unallocated pool.

The pointer of data.

T* getFirst ( )
inline

Get the first data of allocated pool.

The pointer of data.

var getFirst ( )
inline

Get the first data of allocated pool.

The pointer of data.

local getFirst ( )
inline

Get the first data of allocated pool.

The pointer of data.

T* getNext ( )
inline

Get the next data of allocated pool.

The pointer of data.

var getNext ( )
inline

Get the next data of allocated pool.

The pointer of data.

local getNext ( )
inline

Get the next data of allocated pool.

The pointer of data.

const PoolList& getActiveDataList ( ) const
inline

Get the allocated pool.

The allocated pool.

var getActiveDataList ( )
inline

Get the allocated pool.

The allocated pool.

local getActiveDataList ( )
inline

Get the allocated pool.

The allocated pool.

const PoolList& getUnActiveDataList ( ) const
inline

Get the unallocated pool.

The unallocated pool.

var getUnActiveDataList ( )
inline

Get the unallocated pool.

The unallocated pool.

local getUnActiveDataList ( )
inline

Get the unallocated pool.

The unallocated pool.


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