Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::RefCntWeakPtr< T > Class Template Reference

Implementation of weak pointer. More...

#include <RefCntAutoPtr.hpp>

Public Member Functions

bool IsValid () const noexcept
 
T * UnsafeRawPtr () noexcept
 
RefCntAutoPtr< T > Lock ()
 Obtains a strong reference to the object.
 

Detailed Description

template<typename T>
class Diligent::RefCntWeakPtr< T >

Implementation of weak pointer.

Member Function Documentation

◆ IsValid()

template<typename T>
bool Diligent::RefCntWeakPtr< T >::IsValid ( ) const
inlinenoexcept
Note
This method may not be reliable in a multithreaded environment. However, when false is returned, the strong pointer created from this weak pointer will reliably be empty.

◆ UnsafeRawPtr()

template<typename T>
T * Diligent::RefCntWeakPtr< T >::UnsafeRawPtr ( )
inlinenoexcept

Returns a raw pointer to the managed object.

Note
The object may or may not be alive. Use Lock() to atomically obtain a strong reference.