morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::testing::detail::LifeSentinel Class Reference

Captured by value in a handler, tells whether the backend destroyed the handler while it ran. More...

#include <backend_conformance.hpp>

Public Member Functions

 LifeSentinel (HandlerLife &life) noexcept
 ~LifeSentinel ()
 Reports its own destruction when it belongs to the running handler.
 LifeSentinel (LifeSentinel const &)=default
 A copy, for another copy of the handler.
LifeSentinel & operator= (LifeSentinel const &)=default
 Copies the report target.
 LifeSentinel (LifeSentinel &&)=default
 A copy, for a moved handler.
LifeSentinel & operator= (LifeSentinel &&)=default
 Copies the report target.
HandlerLife * life () const noexcept
 Where it reports.

Detailed Description

Captured by value in a handler, tells whether the backend destroyed the handler while it ran.

Every copy of the handler holds its own sentinel; only the destruction of the copy that is running counts.

Definition at line 1078 of file backend_conformance.hpp.

Constructor & Destructor Documentation

◆ LifeSentinel()

morph::ui::testing::detail::LifeSentinel::LifeSentinel ( HandlerLife & life)
inlineexplicitnoexcept
Parameters
lifeWhere to report; must outlive every copy.

Definition at line 1081 of file backend_conformance.hpp.

◆ ~LifeSentinel()

morph::ui::testing::detail::LifeSentinel::~LifeSentinel ( )
inline

Reports its own destruction when it belongs to the running handler.

Definition at line 1084 of file backend_conformance.hpp.

Member Function Documentation

◆ operator=() [1/2]

LifeSentinel & morph::ui::testing::detail::LifeSentinel::operator= ( LifeSentinel const & )
default

Copies the report target.

Returns
This sentinel.

◆ operator=() [2/2]

LifeSentinel & morph::ui::testing::detail::LifeSentinel::operator= ( LifeSentinel && )
default

Copies the report target.

Returns
This sentinel.

◆ life()

HandlerLife * morph::ui::testing::detail::LifeSentinel::life ( ) const
inlinenodiscardnoexcept

Where it reports.

Returns
The report.

Definition at line 1103 of file backend_conformance.hpp.


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