Sunshine master
Self-hosted game stream host for Moonlight.
safe::shared_t< T >::ptr_t Struct Reference

Pointer wrapper state protected by synchronization. More...

#include <src/thread_safe.h>

Collaboration diagram for safe::shared_t< T >::ptr_t:
[legend]

Public Member Functions

element_typeget () const
 Return the currently wrapped value or handle.
 
 operator bool () const
 Check whether this shared pointer wrapper owns a live object.
 
element_typeoperator-> ()
 Access the shared protected object.
 
ptr_toperator= (const ptr_t &ptr) noexcept
 Assign state from another instance while preserving ownership semantics.
 
ptr_toperator= (ptr_t &&ptr) noexcept
 Assign state from another instance while preserving ownership semantics.
 
 ptr_t (const ptr_t &ptr) noexcept
 Copy a shared-object reference without locking the protected object.
 
 ptr_t (ptr_t &&ptr) noexcept
 Move a shared-object reference without locking the protected object.
 
 ptr_t (shared_t *owner)
 Construct a reference bound to a shared protected object.
 
void release ()
 Release the COM or platform reference owned by the pointer.
 

Public Attributes

shared_towner
 Shared object that owns the protected value.
 

Detailed Description

template<class T>
struct safe::shared_t< T >::ptr_t

Pointer wrapper state protected by synchronization.

Constructor & Destructor Documentation

◆ ptr_t() [1/3]

template<class T >
safe::shared_t< T >::ptr_t::ptr_t ( shared_t * owner)
inlineexplicit

Construct a reference bound to a shared protected object.

Parameters
ownerShared object that owns this pointer wrapper.

◆ ptr_t() [2/3]

template<class T >
safe::shared_t< T >::ptr_t::ptr_t ( ptr_t && ptr)
inlinenoexcept

Move a shared-object reference without locking the protected object.

Parameters
ptrPointer managed by the safe pointer wrapper.

◆ ptr_t() [3/3]

template<class T >
safe::shared_t< T >::ptr_t::ptr_t ( const ptr_t & ptr)
inlinenoexcept

Copy a shared-object reference without locking the protected object.

Parameters
ptrPointer managed by the safe pointer wrapper.

Member Function Documentation

◆ get()

template<class T >
element_type * safe::shared_t< T >::ptr_t::get ( ) const
inline

Return the currently wrapped value or handle.

Returns
Underlying native handle or object pointer.

◆ operator->()

template<class T >
element_type * safe::shared_t< T >::ptr_t::operator-> ( )
inline

Access the shared protected object.

Returns
Pointer to the object stored in the shared wrapper.

◆ operator=() [1/2]

template<class T >
ptr_t & safe::shared_t< T >::ptr_t::operator= ( const ptr_t & ptr)
inlinenoexcept

Assign state from another instance while preserving ownership semantics.

Parameters
ptrPointer managed by the safe pointer wrapper.
Returns
Reference or value produced by the operator.

◆ operator=() [2/2]

template<class T >
ptr_t & safe::shared_t< T >::ptr_t::operator= ( ptr_t && ptr)
inlinenoexcept

Assign state from another instance while preserving ownership semantics.

Parameters
ptrPointer managed by the safe pointer wrapper.
Returns
Reference or value produced by the operator.

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