wavelength 1.0.0
Loading...
Searching...
No Matches
FxPool< T, bArg > Class Template Reference

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

Detailed Description

template<class T, bool bArg>
class FxPool< T, bArg >

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().

Template Parameters
TThe effect.
bArgThe second template argument. Its meaning is not yet recovered.

Constructor & Destructor Documentation

◆ FxPool()

template<class T, bool bArg>
FxPool< T, bArg >::FxPool ( int nCount)
inlineexplicit

Construct a pool of effects, every one of them free.

Parameters
nCountThe number of effects.
Ghidra address:
NTSC-U/C: 0x00367da8
Ghidra address:
PAL: 0x003d64d8

◆ ~FxPool()

template<class T, bool bArg>
virtual FxPool< T, bArg >::~FxPool ( )
virtualdefault

Destroy the effects.

Ghidra address:
NTSC-U/C: 0x00367eb0
Ghidra address:
PAL: 0x003d65e0

Member Function Documentation

◆ Prepare()

template<class T, bool bArg>
void FxPool< T, bArg >::Prepare ( T * pItem)
inline

Prepare a new effect of the pool.

The body is empty.

The title is inferred.

Parameters
pItemThe effect.
Ghidra address:
NTSC-U/C: 0x00367da0
Ghidra address:
PAL: 0x003d64d0

◆ FindOldest()

template<class T, bool bArg>
T * FxPool< T, bArg >::FindOldest ( )
inline

Report the effect that started first.

Returns
The effect, or null for an empty pool.
Ghidra address:
NTSC-U/C: 0x00368050
Ghidra address:
PAL: 0x003d6780

◆ Pop()

template<class T, bool bArg>
T * FxPool< T, bArg >::Pop ( )
inline

Take an effect off the free list.

Returns
The effect, or null when every effect is in use.
Ghidra address:
NTSC-U/C: 0x003680b0
Ghidra address:
PAL: 0x003d67e0

◆ Start()

template<class T, bool bArg>
template<class... Args>
T * FxPool< T, bArg >::Start ( Args... args)
inline

Take an effect off the free list and start it.

Parameters
argsThe arguments of the effect's Start().
Returns
The effect, or null when every effect is in use.
Ghidra address:
NTSC-U/C: 0x003680d8
Ghidra address:
PAL: 0x003d6808

◆ Release()

template<class T, bool bArg>
void FxPool< T, bArg >::Release ( T * pItem)
inline

Stop an effect and return it to the free list.

Parameters
pItemThe effect.
Ghidra address:
NTSC-U/C: 0x00368150
Ghidra address:
PAL: 0x003d6880

◆ Free()

template<class T, bool bArg>
void FxPool< T, bArg >::Free ( T * pItem)
inline

Return an effect to the pool.

Parameters
pItemThe effect.
Ghidra address:
NTSC-U/C: 0x00368190
Ghidra address:
PAL: 0x003d68c0

Member Data Documentation

◆ mCount

template<class T, bool bArg>
int FxPool< T, bArg >::mCount
protected

The number of effects.

◆ mFree

template<class T, bool bArg>
T* FxPool< T, bArg >::mFree
protected

The head of the free list.

◆ mItems

template<class T, bool bArg>
std::unique_ptr<T[]> FxPool< T, bArg >::mItems
protected

The effects.


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