⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.

Axmol Engine 3.0.0-dff292a
Loading...
Searching...
No Matches
AutoreleasePool Class Reference

A pool for managing autorelease objects. More...

#include <AutoreleasePool.h>

Public Member Functions

 AutoreleasePool ()
 AutoreleasePool (std::string_view name)
 Create an autorelease pool with specific name.
 ~AutoreleasePool ()
 @lua NA
void addObject (Object *object)
 Add a given object to this autorelease pool.
void clear ()
 Clear the autorelease pool.
bool contains (Object *object) const
 Checks whether the autorelease pool contains the specified object.
void dump ()
 Dump the objects that are put into the autorelease pool.

Detailed Description

A pool for managing autorelease objects.

Constructor & Destructor Documentation

◆ AutoreleasePool() [1/2]

Warning
Don't create an autorelease pool in heap, create it in stack. @lua NA

◆ AutoreleasePool() [2/2]

AutoreleasePool ( std::string_view name)

Create an autorelease pool with specific name.

This name is useful for debugging.

Warning
Don't create an autorelease pool in heap, create it in stack. @lua NA
Parameters
nameThe name of created autorelease pool.

Member Function Documentation

◆ addObject()

void addObject ( Object * object)

Add a given object to this autorelease pool.

The same object may be added several times to an autorelease pool. When the pool is destructed, the object's Object::release() method will be called the same times as it was added.

Parameters
objectThe object to be added into the autorelease pool. @lua NA

◆ clear()

void clear ( )

Clear the autorelease pool.

It will invoke each element's release() function.

@lua NA

◆ contains()

bool contains ( Object * object) const

Checks whether the autorelease pool contains the specified object.

Parameters
objectThe object to be checked.
Returns
True if the autorelease pool contains the object, false if not @lua NA

◆ dump()

void dump ( )

Dump the objects that are put into the autorelease pool.

It is used for debugging.

The result will look like: Object pointer address object id reference count

@lua NA


The documentation for this class was generated from the following file:
  • AutoreleasePool.h