TracktionEngine
Loading...
Searching...
No Matches
engine::SafeSelectable< SelectableType > Class Template Reference

Holds a pointer to some type of Selectable, which automatically becomes null if the selectable is deleted. More...

#include <tracktion_Selectable.h>

Public Member Functions

 SafeSelectable ()=default
 Creates a null SafeSelectable.
 SafeSelectable (SelectableType &selectable)
 Creates a SafeSelectable that points at the given selectable.
 SafeSelectable (SelectableType *selectable)
 Creates a SafeSelectable that points at the given selectable.
 SafeSelectable (const SafeSelectable &other) noexcept
 Creates a copy of another SafeSelectable.
SafeSelectable & operator= (const SafeSelectable &other)
 Copies another pointer to this one.
SafeSelectable & operator= (SelectableType *newSelectable)
 Copies another pointer to this one.
SelectableType * get () const noexcept
 Returns the selectable that this pointer refers to, or null if the selectable no longer exists.
 operator SelectableType * () const noexcept
 Returns the selectable that this pointer refers to, or null if the selectable no longer exists.
SelectableType * operator-> () const noexcept
 Returns the selectable that this pointer refers to, or null if the selectable no longer exists.
bool operator== (SelectableType *other) const noexcept
bool operator!= (SelectableType *other) const noexcept
bool operator== (const SafeSelectable &other) const noexcept
bool operator!= (const SafeSelectable &other) const noexcept
bool operator== (const SelectableType &other) const noexcept
bool operator!= (const SelectableType &other) const noexcept
bool operator== (decltype(nullptr)) const noexcept
bool operator!= (decltype(nullptr)) const noexcept

Detailed Description

template<typename SelectableType>
class engine::SafeSelectable< SelectableType >

Holds a pointer to some type of Selectable, which automatically becomes null if the selectable is deleted.

The SelectableType template parameter must be Selectable, or some subclass of Selectable.

Constructor & Destructor Documentation

◆ SafeSelectable() [1/4]

template<typename SelectableType>
engine::SafeSelectable< SelectableType >::SafeSelectable ( )
default

◆ SafeSelectable() [2/4]

template<typename SelectableType>
engine::SafeSelectable< SelectableType >::SafeSelectable ( SelectableType & selectable)

Creates a SafeSelectable that points at the given selectable.

◆ SafeSelectable() [3/4]

template<typename SelectableType>
engine::SafeSelectable< SelectableType >::SafeSelectable ( SelectableType * selectable)

Creates a SafeSelectable that points at the given selectable.

◆ SafeSelectable() [4/4]

template<typename SelectableType>
engine::SafeSelectable< SelectableType >::SafeSelectable ( const SafeSelectable< SelectableType > & other)
noexcept

Creates a copy of another SafeSelectable.

References SafeSelectable().

Member Function Documentation

◆ operator=() [1/2]

template<typename SelectableType>
SafeSelectable & engine::SafeSelectable< SelectableType >::operator= ( const SafeSelectable< SelectableType > & other)

Copies another pointer to this one.

References SafeSelectable().

◆ operator=() [2/2]

template<typename SelectableType>
SafeSelectable & engine::SafeSelectable< SelectableType >::operator= ( SelectableType * newSelectable)

Copies another pointer to this one.

References SafeSelectable().

◆ get()

template<typename SelectableType>
SelectableType * engine::SafeSelectable< SelectableType >::get ( ) const
noexcept

Returns the selectable that this pointer refers to, or null if the selectable no longer exists.

Referenced by operator->().

◆ operator SelectableType *()

template<typename SelectableType>
engine::SafeSelectable< SelectableType >::operator SelectableType * ( ) const
noexcept

Returns the selectable that this pointer refers to, or null if the selectable no longer exists.

◆ operator->()

template<typename SelectableType>
SelectableType * engine::SafeSelectable< SelectableType >::operator-> ( ) const
noexcept

Returns the selectable that this pointer refers to, or null if the selectable no longer exists.

References get().

◆ operator==() [1/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator== ( SelectableType * other) const
noexcept

◆ operator!=() [1/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator!= ( SelectableType * other) const
noexcept

◆ operator==() [2/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator== ( const SafeSelectable< SelectableType > & other) const
noexcept

References SafeSelectable().

◆ operator!=() [2/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator!= ( const SafeSelectable< SelectableType > & other) const
noexcept

References SafeSelectable().

◆ operator==() [3/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator== ( const SelectableType & other) const
noexcept

◆ operator!=() [3/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator!= ( const SelectableType & other) const
noexcept

◆ operator==() [4/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator== ( decltype(nullptr) ) const
noexcept

◆ operator!=() [4/4]

template<typename SelectableType>
bool engine::SafeSelectable< SelectableType >::operator!= ( decltype(nullptr) ) const
noexcept

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