engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TMediaObjectPool< ObjectType, ObjectAllocator > 模板类 参考

Template for media object pools. 更多...

#include <MediaObjectPool.h>

Public 成员函数

ObjectType * Acquire ()
 Acquire an untracked object from the pool. 更多...
 
TSharedRef< ObjectType, ESPMode::ThreadSafe > AcquireShared ()
 Acquire a shared object from the pool. 更多...
 
int32 Num () const
 Get the number of objects available in the pool. 更多...
 
void Release (ObjectType *Object)
 Return the given object to the pool. 更多...
 
void Reset (uint32 NumObjects=0)
 Reset the pool and reserve a specified number of objects. 更多...
 
void Tick ()
 Regular tick call
 
 TMediaObjectPool (ObjectAllocator *ObjectAllocatorInstance=nullptr)
 Default constructor.
 
 TMediaObjectPool (uint32 NumReserve)
 Create and initialize a new instance. 更多...
 
TSharedRef< ObjectType, ESPMode::ThreadSafe > ToShared (ObjectType *Object)
 Convert an object to a shared pooled object. 更多...
 

详细描述

template<typename ObjectType, typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
class TMediaObjectPool< ObjectType, ObjectAllocator >

Template for media object pools.

Poolable objects are required to implement the IMediaPoolable interface.

参数
ObjectTypeThe type of objects managed by this pool.
待办事项:
gmp: Make media object pool lock-free

构造及析构函数说明

◆ TMediaObjectPool()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
TMediaObjectPool< ObjectType, ObjectAllocator >::TMediaObjectPool ( uint32  NumReserve)
inline

Create and initialize a new instance.

参数
NumReserveNumber of objects to reserve.

成员函数说明

◆ Acquire()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
ObjectType * TMediaObjectPool< ObjectType, ObjectAllocator >::Acquire ( )
inline

Acquire an untracked object from the pool.

Use the Release method to return the object to the pool. You can use the ToShared and ToUnique methods to convert this object to a tracked shared object later if desired.

返回
The object.
参见
AcquireShared, AcquireUnique, Release, ToShared, ToUnique

◆ AcquireShared()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
TSharedRef< ObjectType, ESPMode::ThreadSafe > TMediaObjectPool< ObjectType, ObjectAllocator >::AcquireShared ( )
inline

Acquire a shared object from the pool.

Shared objects do not need to be returned to the pool. They'll be reclaimed automatically when their reference count goes to zero.

返回
The shared object.
参见
Acquire, AcquireUnique, Reset, ToShared

◆ Num()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
int32 TMediaObjectPool< ObjectType, ObjectAllocator >::Num ( ) const
inline

Get the number of objects available in the pool.

返回
Number of available objects.

◆ Release()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
void TMediaObjectPool< ObjectType, ObjectAllocator >::Release ( ObjectType *  Object)
inline

Return the given object to the pool.

This method can return plain old C++ objects to the pool. Do not use this method with objects acquired via AcquireShared or AcquireUnique, because those are returned automatically.

参见
Acquire

◆ Reset()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
void TMediaObjectPool< ObjectType, ObjectAllocator >::Reset ( uint32  NumObjects = 0)
inline

Reset the pool and reserve a specified number of objects.

参数
NumObjectsNumber of objects to reserve (default = 0).
参见
GetObject

◆ ToShared()

template<typename ObjectType , typename ObjectAllocator = TMediaPoolDefaultObjectAllocator<ObjectType>>
TSharedRef< ObjectType, ESPMode::ThreadSafe > TMediaObjectPool< ObjectType, ObjectAllocator >::ToShared ( ObjectType *  Object)
inline

Convert an object to a shared pooled object.

参数
ObjectThe object to convert.
返回
The shared object.
参见
AcquireShared, ToUnique

该类的文档由以下文件生成: