ObjectPool

Namespace: ObjectPool Language: C++ Type: Defold C++ File: object_pool.h Source: engine/dlib/src/dmsdk/dlib/object_pool.h Include: dmsdk/dlib/object_pool.h

Object Pool API documentation

API

Alloc

Type: FUNCTION Allocate a new object

Returns

Capacity

Type: FUNCTION

Returns

dmObjectPool

Type: STRUCT Object pool data-structure with the following properties

Template Parameters

dmObjectPool

Type: FUNCTION Constructor

Free

Type: FUNCTION Returns object index to the object pool

Parameters

Full

Type: FUNCTION Checks if the pool is full

Returns

Get

Type: FUNCTION Get object from logical index

Parameters

Returns

GetPtr

Type: FUNCTION Get object pointer from logical index

Parameters

Returns

GetRawObjects

Type: FUNCTION Get the array of currently active objects

Notes

Returns

OffsetCapacity

Type: FUNCTION Grow by an amount.

Parameters

Set

Type: FUNCTION Set object from logical index

Parameters

SetCapacity

Type: FUNCTION Set capacity. New capacity must be >= old_capacity

Parameters

Size

Type: FUNCTION Get number of objects currently stored

Returns