|
wavelength 1.0.0
|
Fixed pool of effects, handed out from a free list and stolen oldest first when it runs dry. More...
#include <fxpool.h>
Public Member Functions | |
| FxPool (int nCount) | |
| Construct a pool of effects, every one of them free. | |
| void | Prepare (T *pItem) |
| Prepare a new effect of the pool. | |
| virtual | ~FxPool ()=default |
| Destroy the effects. | |
| T * | FindOldest () |
| Report the effect that started first. | |
| T * | Pop () |
| Take an effect off the free list. | |
| template<class... Args> | |
| T * | Start (Args... args) |
| Take an effect off the free list and start it. | |
| void | Release (T *pItem) |
| Stop an effect and return it to the free list. | |
| void | Free (T *pItem) |
| Return an effect to the pool. | |
Protected Attributes | |
| int | mCount |
| T * | mFree |
| std::unique_ptr< T[]> | mItems |
Fixed pool of effects, handed out from a free list and stolen oldest first when it runs dry.
The RTTI names the template. The object is 0x10 bytes, with the vptr after the members. An effect type supplies mNextFree, mStartTime, Start(), and Stop().
| T | The effect. |
| bArg | The second template argument. Its meaning is not yet recovered. |
|
inlineexplicit |
Construct a pool of effects, every one of them free.
| nCount | The number of effects. |
Destroy the effects.
|
inline |
Prepare a new effect of the pool.
The body is empty.
The title is inferred.
| pItem | The effect. |
|
inline |
Report the effect that started first.
|
inline |
Take an effect off the free list.
|
inline |
Take an effect off the free list and start it.
| args | The arguments of the effect's Start(). |
|
inline |
Stop an effect and return it to the free list.
| pItem | The effect. |
|
inline |
Return an effect to the pool.
| pItem | The effect. |
|
protected |
The number of effects.
|
protected |
The head of the free list.
|
protected |
The effects.