ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
CP_SDK::Pool::ObjectPool< t_Type > Class Template Reference

Vector based object pool. More...

#include <ObjectPool.hpp>

Inheritance diagram for CP_SDK::Pool::ObjectPool< t_Type >:
Inheritance graph
[legend]
Collaboration diagram for CP_SDK::Pool::ObjectPool< t_Type >:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< ObjectPool< t_Type > >
 

Public Member Functions

 ObjectPool (const typename IObjectPool< t_Type >::__this_is_private &__pvTag, _v::CFuncRef< t_Type > createFunc, _v::CActionRef< t_Type & > actionOnGet, _v::CActionRef< t_Type & > actionOnRelease, _v::CActionRef< t_Type & > actionOnDestroy, bool collectionCheck, int defaultCapacity, int maxSize)
 Constructor.
 
 ~ObjectPool ()
 Destructor.
 
int CountActive ()
 Active elements.
 
int CountInactive () override
 Released element.
 
t_Type Get () override
 Simple get.
 
void Release (t_Type &p_Element) override
 Release an element.
 
void Clear () override
 Clear the object pool.
 

Static Public Member Functions

static Ptr Make (_v::CFuncRef< t_Type > createFunc, _v::CActionRef< t_Type & > actionOnGet=nullptr, _v::CActionRef< t_Type & > actionOnRelease=nullptr, _v::CActionRef< t_Type & > actionOnDestroy=nullptr, bool collectionCheck=true, int defaultCapacity=10, int maxSize=100)
 Constructor.
 

Additional Inherited Members

- Protected Member Functions inherited from CP_SDK::Pool::IObjectPool< t_Type >
 CP_SDK_PRIV_TAG ()
 
 IObjectPool (CP_SDK_PRIV_TAG_ARG())
 Constructor.
 
virtual ~IObjectPool ()
 Destructor.
 

Detailed Description

template<class t_Type>
class CP_SDK::Pool::ObjectPool< t_Type >

Vector based object pool.

Template Parameters
t_TypePooled object type

Definition at line 21 of file ObjectPool.hpp.

Member Typedef Documentation

◆ Ptr

template<class t_Type >
using CP_SDK::Pool::ObjectPool< t_Type >::Ptr = std::shared_ptr<ObjectPool<t_Type> >

Definition at line 36 of file ObjectPool.hpp.

Constructor & Destructor Documentation

◆ ObjectPool()

template<class t_Type >
CP_SDK::Pool::ObjectPool< t_Type >::ObjectPool ( const typename IObjectPool< t_Type >::__this_is_private &  __pvTag,
_v::CFuncRef< t_Type >  createFunc,
_v::CActionRef< t_Type & >  actionOnGet,
_v::CActionRef< t_Type & >  actionOnRelease,
_v::CActionRef< t_Type & >  actionOnDestroy,
bool  collectionCheck,
int  defaultCapacity,
int  maxSize 
)
inline

Constructor.

Definition at line 39 of file ObjectPool.hpp.

◆ ~ObjectPool()

template<class t_Type >
CP_SDK::Pool::ObjectPool< t_Type >::~ObjectPool ( )
inline

Destructor.

Definition at line 68 of file ObjectPool.hpp.

References CP_SDK::Pool::ObjectPool< t_Type >::Clear().

Here is the call graph for this function:

Member Function Documentation

◆ Clear()

template<class t_Type >
void CP_SDK::Pool::ObjectPool< t_Type >::Clear ( )
inlineoverridevirtual

Clear the object pool.

Implements CP_SDK::Pool::IObjectPool< t_Type >.

Definition at line 137 of file ObjectPool.hpp.

Referenced by CP_SDK::Pool::ObjectPool< t_Type >::~ObjectPool().

Here is the caller graph for this function:

◆ CountActive()

template<class t_Type >
int CP_SDK::Pool::ObjectPool< t_Type >::CountActive ( )
inline

Active elements.

Definition at line 90 of file ObjectPool.hpp.

◆ CountInactive()

template<class t_Type >
int CP_SDK::Pool::ObjectPool< t_Type >::CountInactive ( )
inlineoverridevirtual

Released element.

Implements CP_SDK::Pool::IObjectPool< t_Type >.

Definition at line 95 of file ObjectPool.hpp.

Referenced by CP_SDK::Pool::ObjectPool< t_Type >::Release().

Here is the caller graph for this function:

◆ Get()

template<class t_Type >
t_Type CP_SDK::Pool::ObjectPool< t_Type >::Get ( )
inlineoverridevirtual

Simple get.

Implements CP_SDK::Pool::IObjectPool< t_Type >.

Definition at line 102 of file ObjectPool.hpp.

◆ Make()

template<class t_Type >
static Ptr CP_SDK::Pool::ObjectPool< t_Type >::Make ( _v::CFuncRef< t_Type >  createFunc,
_v::CActionRef< t_Type & >  actionOnGet = nullptr,
_v::CActionRef< t_Type & >  actionOnRelease = nullptr,
_v::CActionRef< t_Type & >  actionOnDestroy = nullptr,
bool  collectionCheck = true,
int  defaultCapacity = 10,
int  maxSize = 100 
)
inlinestatic

Constructor.

Returns
Created memeory pool

Definition at line 75 of file ObjectPool.hpp.

◆ Release()

template<class t_Type >
void CP_SDK::Pool::ObjectPool< t_Type >::Release ( t_Type &  p_Element)
inlineoverridevirtual

Release an element.

Parameters
p_ElementElement to release

Implements CP_SDK::Pool::IObjectPool< t_Type >.

Definition at line 122 of file ObjectPool.hpp.

References CP_SDK::Pool::ObjectPool< t_Type >::CountInactive().

Here is the call graph for this function:

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