PGE API 0.4
PR00F's Game Engine full documentation
|
Only classes derived from PgePooledObject can be stored in PgeObjectPool. More...
Only classes derived from PgePooledObject can be stored in PgeObjectPool.
Rules for making such derived class:
See PgeObjectPoolTest or the PRooFPS-dd project for real examples.
Definition at line 57 of file PgeObjectPool.h.
#include <PgeObjectPool.h>
Public Member Functions | |
virtual | ~PgePooledObject ()=default |
PgePooledObject (const PgePooledObject &)=default | |
PgePooledObject & | operator= (const PgePooledObject &)=default |
PgePooledObject (PgePooledObject &&)=default | |
PgePooledObject & | operator= (PgePooledObject &&)=default |
PgeObjectPoolBase & | getParentPool () |
const PgeObjectPoolBase & | getParentPool () const |
const bool & | used () const |
virtual void | onSetUsed () |
Gets invoked by setUsed(). | |
const PgePooledObject * | next () const |
PgePooledObject * | next () |
void | remove () |
Convenience function. | |
Protected Member Functions | |
PgePooledObject (PgeObjectPoolBase &parentPool) | |
Private Member Functions | |
void | setUsed (const bool &state) |
void | setNext (PgePooledObject *ptr) |
Private Attributes | |
PgeObjectPoolBase & | m_parentPool |
bool | m_isUsed {false} |
PgePooledObject * | m_pNext {nullptr} |
Friends | |
template<typename T > | |
class | PgeObjectPool |
Only PgeObjectPool should instantiate such pooled object, passing itself to this instance. | |
|
virtualdefault |
|
default |
|
default |
|
inlineprotected |
Definition at line 125 of file PgeObjectPool.h.
|
inline |
Definition at line 71 of file PgeObjectPool.h.
|
inline |
Definition at line 79 of file PgeObjectPool.h.
|
inline |
Definition at line 104 of file PgeObjectPool.h.
|
inline |
Definition at line 99 of file PgeObjectPool.h.
|
inlinevirtual |
Gets invoked by setUsed().
Derived class can override this to take action whenever the object's used state changes.
Reimplemented in PooledBullet.
Definition at line 96 of file PgeObjectPool.h.
|
default |
|
default |
|
inline |
Convenience function.
Equivalent to: PgeObjectPool.remove(*this) .
Definition at line 112 of file PgeObjectPool.h.
|
inlineprivate |
Definition at line 141 of file PgeObjectPool.h.
|
inlineprivate |
Definition at line 135 of file PgeObjectPool.h.
|
inline |
Definition at line 87 of file PgeObjectPool.h.
|
friend |
Only PgeObjectPool should instantiate such pooled object, passing itself to this instance.
Obviously not private so we allow user to derive from this class.
Definition at line 123 of file PgeObjectPool.h.
|
private |
Definition at line 130 of file PgeObjectPool.h.
|
private |
Definition at line 129 of file PgeObjectPool.h.
|
private |
Definition at line 131 of file PgeObjectPool.h.