VLink  2.0.0
A high-performance communication middleware
vlink::ObjectPool< T >::PoolDeleter结构体 参考final

Custom deleter installed on every RAII handle handed out by get / get_shared. 更多...

#include <object_pool.h>

vlink::ObjectPool< T >::PoolDeleter 的协作图:

Public 成员函数

void operator() (T *ptr) const noexcept
 Returns ptr to the pool, or deletes it when the pool is gone. 更多...
 

Public 属性

std::weak_ptr< ObjectPool< T > > weak_pool
 Weak reference to the parent pool. 更多...
 

详细描述

template<typename T>
struct vlink::ObjectPool< T >::PoolDeleter

Custom deleter installed on every RAII handle handed out by get / get_shared.

Holds a non-owning weak_ptr to the parent pool. When the handle is destroyed, the deleter either returns the object via release() (when the pool is alive) or falls back to operator delete (when the pool has already been torn down).

成员函数说明

◆ operator()()

template<typename T >
void vlink::ObjectPool< T >::PoolDeleter::operator() ( T *  ptr) const
inlinenoexcept

Returns ptr to the pool, or deletes it when the pool is gone.

参数
ptrRaw pointer to the object being released; nullptr is silently ignored.

类成员变量说明

◆ weak_pool

template<typename T >
std::weak_ptr<ObjectPool<T> > vlink::ObjectPool< T >::PoolDeleter::weak_pool

Weak reference to the parent pool.


该结构体的文档由以下文件生成: