Sese Framework
2.3.0
A cross-platform framework
|
Object pool. More...
#include <ObjectPool.h>
Public Types | |
using | Ptr = std::shared_ptr<ObjectPool<T>> |
using | ObjectPtr = std::shared_ptr<T> |
Public Member Functions | |
~ObjectPool () override | |
auto | borrow () noexcept |
Public Member Functions inherited from sese::Noncopyable | |
Noncopyable ()=default | |
virtual | ~Noncopyable ()=default |
Noncopyable (const Noncopyable &)=delete | |
Noncopyable & | operator= (const Noncopyable &)=delete |
Static Public Member Functions | |
static ObjectPool::Ptr | create () noexcept |
Private Member Functions | |
ObjectPool ()=default | |
Static Private Member Functions | |
static void | recycleCallback (const std::weak_ptr< ObjectPool > &wk_pool, T *to_recycle) noexcept |
Private Attributes | |
std::mutex | mutex |
std::queue< T * > | queue |
Object pool.
T | Reusable object type |
using sese::ObjectPool< T >::ObjectPtr = std::shared_ptr<T> |
using sese::ObjectPool< T >::Ptr = std::shared_ptr<ObjectPool<T>> |
|
inlineoverride |
References sese::ObjectPool< T >::queue.
|
privatedefault |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticprivatenoexcept |
Referenced by sese::ObjectPool< T >::borrow().
|
private |
Referenced by sese::ObjectPool< T >::borrow().
|
private |
Referenced by sese::ObjectPool< T >::borrow(), and sese::ObjectPool< T >::~ObjectPool().