Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::physics::TaskPool Class Reference

#include <PhysicsTaskPool.hpp>

Public Member Functions

 TaskPool ()
 ~TaskPool ()
 TaskPool (const TaskPool &)=delete
TaskPool & operator= (const TaskPool &)=delete
int workerCount () const
void configure (b2WorldDef &def)

Detailed Description

A fixed pool of worker threads Box2D enqueues onto. Not general purpose: it exists to satisfy b2EnqueueTaskCallback / b2FinishTaskCallback, and its lifetime is the physics world's.

Definition at line 49 of file PhysicsTaskPool.hpp.

Constructor & Destructor Documentation

◆ TaskPool() [1/2]

esengine::physics::TaskPool::TaskPool ( )

Builds a pool sized from the hardware, or an empty one when there is only a single core to schedule on (in which case Box2D solves inline).

Definition at line 21 of file PhysicsTaskPool.cpp.

Referenced by TaskPool(), and operator=().

◆ ~TaskPool()

esengine::physics::TaskPool::~TaskPool ( )

Definition at line 40 of file PhysicsTaskPool.cpp.

◆ TaskPool() [2/2]

esengine::physics::TaskPool::TaskPool ( const TaskPool & )
delete

References TaskPool().

Member Function Documentation

◆ configure()

void esengine::physics::TaskPool::configure ( b2WorldDef & def)

Wire this pool into a world definition. A pool with no workers leaves the definition alone, so the world stays on the calling thread.

Definition at line 51 of file PhysicsTaskPool.cpp.

◆ operator=()

TaskPool & esengine::physics::TaskPool::operator= ( const TaskPool & )
delete

References TaskPool().

◆ workerCount()

int esengine::physics::TaskPool::workerCount ( ) const
inline

How many workers Box2D should split a step across, counting the calling thread; 0 when the pool is inactive and the world stays single-threaded.

Definition at line 61 of file PhysicsTaskPool.hpp.


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