Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::CancelRegistration Class Reference

RAII registration returned by CancelToken::register_callback. More...

#include <cancel.hpp>

Public Member Functions

 CancelRegistration () noexcept=default
 ~CancelRegistration ()
 CancelRegistration (const CancelRegistration &)=delete
CancelRegistration & operator= (const CancelRegistration &)=delete
 CancelRegistration (CancelRegistration &&other) noexcept
CancelRegistration & operator= (CancelRegistration &&other) noexcept
 operator bool () const noexcept
 True while the callback is still registered and has not yet been run.
void reset () noexcept
 Unregister now. Idempotent.

Friends

class CancelToken

Detailed Description

RAII registration returned by CancelToken::register_callback.

Destroying (or reset()-ing) a registration guarantees the callback is not running and will not run afterwards: if another thread is mid-callback, the destructor waits for it to return. A registration destroyed from inside its own callback does not wait.

Constructor & Destructor Documentation

◆ CancelRegistration() [1/3]

pulp::runtime::CancelRegistration::CancelRegistration ( )
defaultnoexcept

◆ ~CancelRegistration()

pulp::runtime::CancelRegistration::~CancelRegistration ( )

◆ CancelRegistration() [2/3]

pulp::runtime::CancelRegistration::CancelRegistration ( const CancelRegistration & )
delete

◆ CancelRegistration() [3/3]

pulp::runtime::CancelRegistration::CancelRegistration ( CancelRegistration && other)
noexcept

Member Function Documentation

◆ operator bool()

pulp::runtime::CancelRegistration::operator bool ( ) const
inlineexplicitnodiscardnoexcept

True while the callback is still registered and has not yet been run.

◆ operator=() [1/2]

CancelRegistration & pulp::runtime::CancelRegistration::operator= ( CancelRegistration && other)
noexcept

◆ operator=() [2/2]

CancelRegistration & pulp::runtime::CancelRegistration::operator= ( const CancelRegistration & )
delete

◆ reset()

void pulp::runtime::CancelRegistration::reset ( )
noexcept

Unregister now. Idempotent.

◆ CancelToken

friend class CancelToken
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/runtime/include/pulp/runtime/cancel.hpp