NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::tui::ref< T > 模板类 参考

可变引用适配器 更多...

#include <ref.hpp>

Public 成员函数

 ref ()
 默认构造
 ref (T value)
 从值构造
 ref (T *ptr)
 从指针构造
T & operator* ()
 解引用
const T & operator* () const
 常量解引用
T * operator-> ()
 成员访问
const T * operator-> () const
 常量成员访问
refoperator= (T v)
 赋值(同时写入绑定的外部变量)
bool holds_pointer () const noexcept
 检查是否绑定外部指针

详细描述

template<typename T>
class neforce::tui::ref< T >

可变引用适配器

模板参数
T值类型

可持有 T 值或引用外部 T*。 组件通过 Ref<T> 接受绑定参数,调用者可以 传递值(组件拥有状态)或指针(绑定外部状态)。

在文件 ref.hpp31 行定义.

构造及析构函数说明

◆ ref() [1/2]

template<typename T>
neforce::tui::ref< T >::ref ( T value)
inlineexplicit

从值构造

参数
value初始值

在文件 ref.hpp43 行定义.

引用了 neforce::move().

◆ ref() [2/2]

template<typename T>
neforce::tui::ref< T >::ref ( T * ptr)
inlineexplicit

从指针构造

参数
ptr外部变量指针

在文件 ref.hpp50 行定义.

成员函数说明

◆ holds_pointer()

template<typename T>
bool neforce::tui::ref< T >::holds_pointer ( ) const
inlinenodiscardnoexcept

检查是否绑定外部指针

返回
是否借用外部状态

在文件 ref.hpp105 行定义.

被这些函数引用 operator*(), operator*() , 以及 operator=().

◆ operator*() [1/2]

template<typename T>
T & neforce::tui::ref< T >::operator* ( )
inline

解引用

返回
值的引用

在文件 ref.hpp57 行定义.

引用了 holds_pointer().

被这些函数引用 operator->() , 以及 operator->().

◆ operator*() [2/2]

template<typename T>
const T & neforce::tui::ref< T >::operator* ( ) const
inline

常量解引用

返回
值的常量引用

在文件 ref.hpp68 行定义.

引用了 holds_pointer().

◆ operator->() [1/2]

template<typename T>
T * neforce::tui::ref< T >::operator-> ( )
inline

成员访问

返回
值的指针

在文件 ref.hpp79 行定义.

引用了 operator*().

◆ operator->() [2/2]

template<typename T>
const T * neforce::tui::ref< T >::operator-> ( ) const
inline

常量成员访问

返回
值的常量指针

在文件 ref.hpp85 行定义.

引用了 operator*().

◆ operator=()

template<typename T>
ref & neforce::tui::ref< T >::operator= ( T v)
inline

赋值(同时写入绑定的外部变量)

参数
v新值
返回
自身引用

在文件 ref.hpp92 行定义.

引用了 holds_pointer(), neforce::move() , 以及 ref().


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