xgboost
|
侵入式指针的实现。一种智能指针,指向带有嵌入式引用计数器的对象。底层对象必须实现一个友元函数 IntrusivePtrRefCount(),该函数返回引用计数器(类型为 IntrusivePtrCell)。侵入式指针比 std::shared_ptr<> 更快:std::shared_ptr<> 会为引用计数器进行额外的内存分配,而侵入式指针则不会。更多...
#include <intrusive_ptr.h>
类 | |
struct | Hash |
公共类型 | |
using | 元素类型 = T |
公共成员函数 | |
IntrusivePtr (T *p) | |
从裸指针构造一个 IntrusivePtr。IntrusivePtr 获得所有权。更多... | |
IntrusivePtr () noexcept=default | |
IntrusivePtr (IntrusivePtr const &that) | |
IntrusivePtr (IntrusivePtr &&that) noexcept | |
~IntrusivePtr () | |
IntrusivePtr< T > & | operator= (IntrusivePtr< T > const &that) |
IntrusivePtr< T > & | operator= (IntrusivePtr< T > &&that) noexcept |
void | 重置 () |
void | 重置 (元素类型 *that) |
元素类型 & | operator* () const noexcept |
元素类型 * | operator-> () const noexcept |
元素类型 * | get () const noexcept |
operator bool () const noexcept | |
int32_t | 引用计数 () noexcept |
void | 交换 (IntrusivePtr< T > &that) noexcept |
保护属性 | |
T * | ptr_ {nullptr} |
侵入式指针的实现。一种智能指针,指向带有嵌入式引用计数器的对象。底层对象必须实现一个友元函数 IntrusivePtrRefCount(),该函数返回引用计数器(类型为 IntrusivePtrCell)。侵入式指针比 std::shared_ptr<> 更快:std::shared_ptr<> 会为引用计数器进行额外的内存分配,而侵入式指针则不会。
using xgboost::IntrusivePtr< T >::元素类型 = T |
|
inlineexplicit |
从裸指针构造一个 IntrusivePtr。IntrusivePtr 获得所有权。
p | 指向对象的裸指针 |
|
defaultnoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
protected |