libxr
Embedded C++ framework for bare-metal, RTOS and Linux
Loading...
Searching...
No Matches
LibXR::ObjectPool< Data >::Slot Class Reference

槽位:引用计数、空闲链接和常驻负载。 Slot: reference count, free-stack link and resident payload. More...

#include <object_pool.hpp>

Public Member Functions

 Slot ()=default
 默认构造负载 / Default-construct the payload.
 
template<typename... Args>
requires std::is_constructible_v<Data, Args...>
 Slot (std::in_place_t, Args &&... args)
 用参数原地构造负载 / Construct the payload in place from arguments.
 
 Slot (const Slot &)=delete
 
Slot & operator= (const Slot &)=delete
 
 Slot (Slot &&)=delete
 
Slot & operator= (Slot &&)=delete
 

Friends

class ObjectPool
 

Detailed Description

template<typename Data>
class LibXR::ObjectPool< Data >::Slot

槽位:引用计数、空闲链接和常驻负载。 Slot: reference count, free-stack link and resident payload.

Note
外部存储须提供 Slot 数组,并保持到池及所有句柄使用结束。 External Slot arrays must outlive pool use and all handles.

Definition at line 58 of file object_pool.hpp.

Constructor & Destructor Documentation

◆ Slot()

template<typename Data >
template<typename... Args>
requires std::is_constructible_v<Data, Args...>
LibXR::ObjectPool< Data >::Slot::Slot ( std::in_place_t ,
Args &&... args )
inlineexplicit

用参数原地构造负载 / Construct the payload in place from arguments.

Parameters
args负载构造参数 / Payload constructor arguments.

Definition at line 72 of file object_pool.hpp.

72 : data_(std::forward<Args>(args)...)
73 {
74 }

Friends And Related Symbol Documentation

◆ ObjectPool

template<typename Data >
friend class ObjectPool
friend

Definition at line 82 of file object_pool.hpp.


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