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

Non-owning observation of a registry-owned object. 更多...

#include <RuntimeBorrow.h>

Public 成员函数

constexpr Borrowed () noexcept=default
 Constructs an unbound Borrowed.
 
constexpr Borrowed (T *value, std::uint64_t ownerEpoch=0) noexcept
 Constructs a Borrowed from a nullable pointer.
 
constexpr Borrowed (T &value, std::uint64_t ownerEpoch=0) noexcept
 Constructs a Borrowed from a live reference.
 
constexpr T * get () const noexcept
 Returns the observed pointer, or nullptr when unbound.
 
constexpr bool isBound () const noexcept
 Returns whether the observation currently names an object.
 
constexpr std::uint64_t ownerEpoch () const noexcept
 Returns the epoch of the owner that produced this observation.
 
constexpr T * operator-> () const noexcept
 Pointer-like access to the borrowed object.
 
constexpr T & operator* () const noexcept
 Dereferences the borrowed object; the caller owns validity proof.
 

详细描述

template<class T>
class eve::script::Borrowed< T >

Non-owning observation of a registry-owned object.

模板参数
TObserved object type; may be incomplete at the declaration site. @ownership Never owns; the producing registry remains responsible for destruction. @lifetime Valid only while the owner epoch remains current and no owner mutation, restore, clear or destruction has occurred.

在文件 RuntimeBorrow.h 第 27 行定义.

构造及析构函数说明

◆ Borrowed() [1/3]

template<class T >
constexpr eve::script::Borrowed< T >::Borrowed ( )
constexprdefaultnoexcept

Constructs an unbound Borrowed.

◆ Borrowed() [2/3]

template<class T >
constexpr eve::script::Borrowed< T >::Borrowed ( T *  value,
std::uint64_t  ownerEpoch = 0 
)
inlineexplicitconstexprnoexcept

Constructs a Borrowed from a nullable pointer.

在文件 RuntimeBorrow.h 第 32 行定义.

◆ Borrowed() [3/3]

template<class T >
constexpr eve::script::Borrowed< T >::Borrowed ( T &  value,
std::uint64_t  ownerEpoch = 0 
)
inlineexplicitconstexprnoexcept

Constructs a Borrowed from a live reference.

在文件 RuntimeBorrow.h 第 35 行定义.

成员函数说明

◆ get()

template<class T >
constexpr T * eve::script::Borrowed< T >::get ( ) const
inlineconstexprnoexcept

Returns the observed pointer, or nullptr when unbound.

返回
A nullable borrowed pointer; this wrapper never transfers ownership. @ownership Borrowed from the owner that created this observation. @nullable Yes. @lifetime Valid only while the owner epoch remains current and no owner mutation, restore, clear or destruction has occurred. @thread Use on the owner thread; the wrapper provides no synchronization. @reentrancy Does not extend lifetime or invoke callbacks.

在文件 RuntimeBorrow.h 第 48 行定义.

◆ isBound()

template<class T >
constexpr bool eve::script::Borrowed< T >::isBound ( ) const
inlineconstexprnoexcept

Returns whether the observation currently names an object.

在文件 RuntimeBorrow.h 第 50 行定义.

◆ operator*()

template<class T >
constexpr T & eve::script::Borrowed< T >::operator* ( ) const
inlineconstexprnoexcept

Dereferences the borrowed object; the caller owns validity proof.

在文件 RuntimeBorrow.h 第 56 行定义.

◆ operator->()

template<class T >
constexpr T * eve::script::Borrowed< T >::operator-> ( ) const
inlineconstexprnoexcept

Pointer-like access to the borrowed object.

在文件 RuntimeBorrow.h 第 54 行定义.

◆ ownerEpoch()

template<class T >
constexpr std::uint64_t eve::script::Borrowed< T >::ownerEpoch ( ) const
inlineconstexprnoexcept

Returns the epoch of the owner that produced this observation.

在文件 RuntimeBorrow.h 第 52 行定义.


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