#include <audio/utility/safeptr.h>
Public Member Functions | |
SafePtr ()=default | |
SafePtr (SafeOwner< T > &owner) | |
~SafePtr () | |
SafePtr (const SafePtr< T > &other) | |
SafePtr & | operator= (const SafePtr< T > &other) |
template<typename OTHER > | |
SafePtr (const SafePtr< OTHER > &other) | |
template<typename OTHER > | |
SafePtr & | operator= (const SafePtr< OTHER > &other) |
SafePtr (const std::nullptr_t) | |
SafePtr & | operator= (const std::nullptr_t) |
SafePtr (SafePtr< T > &&other) | |
SafePtr< T > & | operator= (SafePtr< T > &&other) |
template<typename OTHER > | |
SafePtr (SafePtr< OTHER > &&other) | |
template<typename OTHER > | |
SafePtr< T > & | operator= (SafePtr< OTHER > &&other) |
const T & | operator* () const |
T & | operator* () |
T * | operator-> () const |
T * | operator-> () |
template<typename OTHER > | |
bool | operator== (const OTHER *ptr) const |
template<typename OTHER > | |
bool | operator!= (const OTHER *ptr) const |
bool | operator== (const std::nullptr_t) const |
bool | operator!= (const std::nullptr_t) const |
T * | get () const |
T * | get () |
A SafePtr points to an object that is owned by a SafeOwner somewhere. When the owner goes out of scope and the pointed object will be moved into the DeletionQueue the SafePtr will return true when checked if it equals nullptr. However the object it points to can still be used and safely accessed using the * and -> operators and the get() method until the next time the DeletionQueue is cleared. This way SafePtr guarantees that it can be safely used on both the thread where the SafeOwner went out of scope AND the thread that periodically empties the DeletionQueue, as long as you check if the SafePtr != nullptr before use.
|
default |
~SafePtr | ( | ) |
The destructor removes this Safeptr from the list of SafePtrs that will be mNotified when the object is destroyed.
SafePtr | ( | const std::nullptr_t | ) |
T* get | ( | ) |
T* get | ( | ) | const |
bool operator!= | ( | const OTHER * | ptr | ) | const |
bool operator!= | ( | const std::nullptr_t | ) | const |
T& operator* | ( | ) |
const T& operator* | ( | ) | const |
T* operator-> | ( | ) |
T* operator-> | ( | ) | const |
SafePtr& operator= | ( | const std::nullptr_t | ) |
bool operator== | ( | const OTHER * | ptr | ) | const |
bool operator== | ( | const std::nullptr_t | ) | const |