qxLib
Public Member Functions | List of all members
qx::observer_token_data Class Reference

Tokens are used to automatically detach observer when the observer object is destroyed. More...

#include <observer.h>

Public Member Functions

 observer_token_data (base_subject *pSubject, void *pObserver) noexcept
 observer_token object constructor More...
 
 observer_token_data (observer_token_data &&other) noexcept
 observer_token object constructor More...
 
void reset () noexcept
 Reset observer_token. More...
 
 operator bool () const noexcept
 operator bool More...
 

Detailed Description

Tokens are used to automatically detach observer when the observer object is destroyed.

~

Author
Khrapov
Date
10.03.2021

Definition at line 36 of file observer.h.

Constructor & Destructor Documentation

◆ observer_token_data() [1/2]

qx::observer_token_data::observer_token_data ( base_subject pSubject,
void *  pObserver 
)
inlinenoexcept

observer_token object constructor

Parameters
pSubject- corresponding subject pointer
pObserver- corresponding observer pointer

Definition at line 15 of file observer.inl.

◆ observer_token_data() [2/2]

qx::observer_token_data::observer_token_data ( observer_token_data &&  other)
inlinenoexcept

observer_token object constructor

Parameters
other- other observer_token object rvalue ref

Definition at line 30 of file observer.inl.

Member Function Documentation

◆ operator bool()

qx::observer_token_data::operator bool ( ) const
inlinenoexcept

operator bool

Return values
-true if observer_token is valid

Definition at line 53 of file observer.inl.

◆ reset()

void qx::observer_token_data::reset ( )
inlinenoexcept

Reset observer_token.

Token won't unsubscribe observer from subject in destructor

Definition at line 21 of file observer.inl.


The documentation for this class was generated from the following files: