载入中...
搜索中...
未找到
eve::Subscription类 参考

Move-only RAII token that owns one observer registration. 更多...

#include <Subscription.h>

Public 类型

using Cancel = std::function< void()>
 

Public 成员函数

 Subscription () noexcept=default
 Creates an inactive token.
 
 Subscription (Cancel cancel)
 Creates a token from a cancellation callback.
 
 Subscription (const Subscription &)=delete
 
Subscription & operator= (const Subscription &)=delete
 
 Subscription (Subscription &&other) noexcept
 Subscription.
 
Subscription & operator= (Subscription &&other) noexcept
 Operator =.
 
 ~Subscription ()
 Subscription.
 
void dispose () noexcept
 Cancels this registration; safe to call repeatedly.
 
bool disposed () const noexcept
 Returns whether this token is inactive or has already been disposed.
 
bool isDisposed () const noexcept
 Compatibility spelling for disposed().
 

详细描述

Move-only RAII token that owns one observer registration.

Destroying or explicitly disposing the token cancels the registration. The cancellation operation is idempotent, and a moved-from token is inactive. The cancellation callback must be non-throwing; dispose() is noexcept and is therefore suitable for destructor use.

A token belongs to the thread-affine observer that created it. It must be disposed or destroyed on that observer's owner thread unless the observer explicitly documents a stronger cross-thread guarantee.

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

成员类型定义说明

◆ Cancel

using eve::Subscription::Cancel = std::function<void()>

在文件 Subscription.h 第 29 行定义.

构造及析构函数说明

◆ Subscription() [1/4]

eve::Subscription::Subscription ( )
defaultnoexcept

Creates an inactive token.

◆ Subscription() [2/4]

eve::Subscription::Subscription ( Cancel  cancel)
explicit

Creates a token from a cancellation callback.

参数
cancelNon-throwing callback invoked at most once on disposal.

在文件 Subscription.cpp 第 7 行定义.

◆ Subscription() [3/4]

eve::Subscription::Subscription ( const Subscription &  )
delete

◆ Subscription() [4/4]

eve::Subscription::Subscription ( Subscription &&  other)
noexcept

Subscription.

在文件 Subscription.cpp 第 9 行定义.

◆ ~Subscription()

eve::Subscription::~Subscription ( )

Subscription.

在文件 Subscription.cpp 第 23 行定义.

引用了 dispose().

成员函数说明

◆ dispose()

void eve::Subscription::dispose ( )
noexcept

Cancels this registration; safe to call repeatedly.

在文件 Subscription.cpp 第 25 行定义.

被这些函数引用 eve::ui::PropertyComponent::bind() , 以及 ~Subscription().

◆ disposed()

bool eve::Subscription::disposed ( ) const
inlinenoexcept

Returns whether this token is inactive or has already been disposed.

在文件 Subscription.h 第 53 行定义.

◆ isDisposed()

bool eve::Subscription::isDisposed ( ) const
inlinenoexcept

Compatibility spelling for disposed().

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

◆ operator=() [1/2]

Subscription & eve::Subscription::operator= ( const Subscription &  )
delete

◆ operator=() [2/2]

Subscription & eve::Subscription::operator= ( Subscription &&  other)
noexcept

Operator =.

在文件 Subscription.cpp 第 14 行定义.


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