Navigation
API > API/Plugins > API/Plugins/HarmonixDsp > API/Plugins/HarmonixDsp/TDynamicObjectPool
Description
Attempts to allocate Num number of objects, given a factory method Allows the FactoryMethod to return a nullptr, which will get culled from the pool. This means the number of instances allocated can be less than the number requested.
| Name | TryAllocate |
| Type | function |
| Header File | /Engine/Plugins/Runtime/Harmonix/Source/HarmonixDsp/Public/HarmonixDsp/ObjectPool.h |
| Include Path | #include "HarmonixDsp/ObjectPool.h" |
int32 TryAllocate
(
int32 Num,
TFunction < FSharedObjectPtr> InFactoryMethod,
bool bInAllowGrowth
)
number of instances successfully created and pooled. Can be fewer than Num requested.