Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::Slot< T >::ReadGuard Class Reference

RAII pin. More...

#include <slot.hpp>

Public Member Functions

 ReadGuard () noexcept=default
 ReadGuard (const ReadGuard &)=delete
ReadGuard & operator= (const ReadGuard &)=delete
 ReadGuard (ReadGuard &&other) noexcept
 ~ReadGuard ()
T * get () const noexcept
T & operator* () const noexcept
T * operator-> () const noexcept
 operator bool () const noexcept

Friends

class Slot

Detailed Description

template<typename T>
class pulp::runtime::Slot< T >::ReadGuard

RAII pin.

While one exists, the value it points at cannot be reclaimed. Holding a guard across a block boundary is legal but pointless; hold it exactly as long as you dereference.

read() is const because pinning does not change the slot — it bumps a mutable counter. The pinned object is handed back as T*, so a Slot<const T> yields const T* and a Slot<T> yields a mutable one.

Constructor & Destructor Documentation

◆ ReadGuard() [1/3]

template<typename T>
pulp::runtime::Slot< T >::ReadGuard::ReadGuard ( )
defaultnoexcept

◆ ReadGuard() [2/3]

template<typename T>
pulp::runtime::Slot< T >::ReadGuard::ReadGuard ( const ReadGuard & )
delete

◆ ReadGuard() [3/3]

template<typename T>
pulp::runtime::Slot< T >::ReadGuard::ReadGuard ( ReadGuard && other)
inlinenoexcept

◆ ~ReadGuard()

template<typename T>
pulp::runtime::Slot< T >::ReadGuard::~ReadGuard ( )
inline

Member Function Documentation

◆ get()

template<typename T>
T * pulp::runtime::Slot< T >::ReadGuard::get ( ) const
inlinenoexcept

◆ operator bool()

template<typename T>
pulp::runtime::Slot< T >::ReadGuard::operator bool ( ) const
inlineexplicitnoexcept

◆ operator*()

template<typename T>
T & pulp::runtime::Slot< T >::ReadGuard::operator* ( ) const
inlinenoexcept

◆ operator->()

template<typename T>
T * pulp::runtime::Slot< T >::ReadGuard::operator-> ( ) const
inlinenoexcept

◆ operator=()

template<typename T>
ReadGuard & pulp::runtime::Slot< T >::ReadGuard::operator= ( const ReadGuard & )
delete

◆ Slot

template<typename T>
friend class Slot
friend

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