载入中...
搜索中...
未找到
eve::script::RuntimePin< T, Tag > 模板类 参考

RAII keep-alive for one RuntimeObjectRegistry entry. 更多...

#include <RuntimeRegistry.h>

Public 类型

using Ref = RuntimeHandleRef< Tag >
 

Public 成员函数

 RuntimePin ()=default
 Constructs an unbound pin.
 
 RuntimePin (const RuntimePin &)=delete
 
RuntimePin & operator= (const RuntimePin &)=delete
 
 RuntimePin (RuntimePin &&other) noexcept
 Moves the keep-alive to a new pin; the source becomes unbound.
 
RuntimePin & operator= (RuntimePin &&other) noexcept
 Move-assigns, releasing any keep-alive this pin already held.
 
 ~RuntimePin ()
 Releases the keep-alive; an erased object is destroyed here.
 
bool isBound () const noexcept
 Whether this pin still keeps an object alive.
 
const Ref & reference () const noexcept
 The reference this pin was created from.
 
T * get () const noexcept
 Borrows the pinned object; valid until the pin is released.
 
Borrowed< T > borrow () const noexcept
 Borrows the pinned object together with its owner epoch.
 
T * operator-> () const noexcept
 Pointer-like access to the pinned object.
 
T & operator* () const noexcept
 Dereferences the pinned object.
 

友元

class RuntimeObjectRegistry< T, Tag >
 

详细描述

template<class T, class Tag>
class eve::script::RuntimePin< T, Tag >

RAII keep-alive for one RuntimeObjectRegistry entry.

Borrowed<T> deliberately does not extend an object's lifetime; a RuntimePin does. The payload survives erase() and clear() for as long as one pin holds it, while the handle itself becomes stale immediately. The pin must not outlive the registry that produced it.

模板参数
TObject type stored by the producing registry.
TagOwner-specific tag of the producing registry.

RuntimePin public API.

在文件 RuntimeRegistry.h 第 276 行定义.

成员类型定义说明

◆ Ref

template<class T , class Tag >
using eve::script::RuntimePin< T, Tag >::Ref = RuntimeHandleRef<Tag>

在文件 RuntimeRegistry.h 第 278 行定义.

构造及析构函数说明

◆ RuntimePin() [1/3]

template<class T , class Tag >
eve::script::RuntimePin< T, Tag >::RuntimePin ( )
default

Constructs an unbound pin.

◆ RuntimePin() [2/3]

template<class T , class Tag >
eve::script::RuntimePin< T, Tag >::RuntimePin ( const RuntimePin< T, Tag > &  )
delete

◆ RuntimePin() [3/3]

template<class T , class Tag >
eve::script::RuntimePin< T, Tag >::RuntimePin ( RuntimePin< T, Tag > &&  other)
inlinenoexcept

Moves the keep-alive to a new pin; the source becomes unbound.

Store.

在文件 RuntimeRegistry.h 第 286 行定义.

◆ ~RuntimePin()

template<class T , class Tag >
eve::script::RuntimePin< T, Tag >::~RuntimePin ( )
inline

Releases the keep-alive; an erased object is destroyed here.

在文件 RuntimeRegistry.h 第 308 行定义.

成员函数说明

◆ borrow()

template<class T , class Tag >
Borrowed< T > eve::script::RuntimePin< T, Tag >::borrow ( ) const
inlinenoexcept

Borrows the pinned object together with its owner epoch.

在文件 RuntimeRegistry.h 第 320 行定义.

引用了 eve::script::RuntimePin< T, Tag >::get() , 以及 eve::script::RuntimeHandleRef< Tag >::ownerEpoch.

◆ get()

template<class T , class Tag >
T * eve::script::RuntimePin< T, Tag >::get ( ) const
inlinenoexcept

◆ isBound()

template<class T , class Tag >
bool eve::script::RuntimePin< T, Tag >::isBound ( ) const
inlinenoexcept

Whether this pin still keeps an object alive.

在文件 RuntimeRegistry.h 第 311 行定义.

◆ operator*()

template<class T , class Tag >
T & eve::script::RuntimePin< T, Tag >::operator* ( ) const
inlinenoexcept

Dereferences the pinned object.

在文件 RuntimeRegistry.h 第 326 行定义.

引用了 eve::script::RuntimePin< T, Tag >::get().

◆ operator->()

template<class T , class Tag >
T * eve::script::RuntimePin< T, Tag >::operator-> ( ) const
inlinenoexcept

Pointer-like access to the pinned object.

在文件 RuntimeRegistry.h 第 323 行定义.

引用了 eve::script::RuntimePin< T, Tag >::get().

◆ operator=() [1/2]

template<class T , class Tag >
RuntimePin & eve::script::RuntimePin< T, Tag >::operator= ( const RuntimePin< T, Tag > &  )
delete

◆ operator=() [2/2]

template<class T , class Tag >
RuntimePin & eve::script::RuntimePin< T, Tag >::operator= ( RuntimePin< T, Tag > &&  other)
inlinenoexcept

Move-assigns, releasing any keep-alive this pin already held.

Release.

在文件 RuntimeRegistry.h 第 294 行定义.

◆ reference()

template<class T , class Tag >
const Ref & eve::script::RuntimePin< T, Tag >::reference ( ) const
inlinenoexcept

The reference this pin was created from.

在文件 RuntimeRegistry.h 第 314 行定义.

友元及相关函数文档

◆ RuntimeObjectRegistry< T, Tag >

template<class T , class Tag >
friend class RuntimeObjectRegistry< T, Tag >
friend

在文件 RuntimeRegistry.h 第 326 行定义.


该类的文档由以下文件生成: