NetDEM v1.0
|
A class implementing object pooling for particles and contacts. More...
#include <dem_object_pool.hpp>
Public Member Functions | |
DEMObjectPool (const DEMObjectPool &)=delete | |
Copy constructor deleted. | |
DEMObjectPool & | operator= (const DEMObjectPool &)=delete |
Copy assignment operator deleted. | |
Particle * | GetParticle () |
Get a free Particle object from the pool, creating a new one if necessary. | |
ContactPP * | GetContactPP () |
Get a free ContactPP object from the pool, creating a new one if necessary. | |
ContactPW * | GetContactPW () |
Get a free ContactPW object from the pool, creating a new one if necessary. | |
ContactPP * | Clone (ContactPP const *cnt) |
Clone a ContactPP object. | |
ContactPW * | Clone (ContactPW const *cnt) |
Clone a ContactPW object. | |
void | RecycleParticle (Particle **p) |
Recycle a Particle object and store it in the pool for later re-use. | |
void | RecycleContactPP (ContactPP **cnt) |
Recycle a ContactPP object and store it in the pool for later re-use. | |
void | RecycleContactPW (ContactPW **cnt) |
Recycle a ContactPW object and store it in the pool for later re-use. | |
void | RecycleParticle (VecXT< Particle * > *p_list) |
Recycle a list of Particle objects and store them in the pool for later re-use. | |
void | RecycleContactPP (VecXT< ContactPP * > *cnt_list) |
Recycle a list of ContactPP objects and store them in the pool for later re-use. | |
void | RecycleContactPW (VecXT< ContactPW * > *cnt_list) |
Recycle a list of ContactPW objects and store them in the pool for later re-use. | |
void | RecycleParticle (VecXT< VecXT< Particle * > > *p_list) |
Recycle a list of lists of Particle objects and store them in the pool for later re-use. | |
~DEMObjectPool () | |
Destructor for the DEMObjectPool class. | |
Static Public Member Functions | |
static DEMObjectPool & | GetInstance () |
Get the singleton instance of the DEMObjectPool. | |
A class implementing object pooling for particles and contacts.
Particle and contacts are frequently added to or removed from the scene. The pool strategy is used to avoid the frequent construction and de-construction of object instances. When a particle or wall needs to be added, an instance will be obtained from the pool. When a particle or wall needs to be removed, it is recycled and stored in the pool for later re-use.
|
delete |
Copy constructor deleted.
netdem::DEMObjectPool::~DEMObjectPool | ( | ) |
Destructor for the DEMObjectPool class.
ContactPP * netdem::DEMObjectPool::GetContactPP | ( | ) |
ContactPW * netdem::DEMObjectPool::GetContactPW | ( | ) |
|
inlinestatic |
Get the singleton instance of the DEMObjectPool.
Particle * netdem::DEMObjectPool::GetParticle | ( | ) |
|
delete |
Copy assignment operator deleted.
void netdem::DEMObjectPool::RecycleContactPP | ( | ContactPP ** | cnt | ) |
void netdem::DEMObjectPool::RecycleContactPW | ( | ContactPW ** | cnt | ) |
void netdem::DEMObjectPool::RecycleParticle | ( | Particle ** | p | ) |