Berserk
Public Member Functions | List of all members
Ref< T > Class Template Reference

Automates reference counting and behaves as shared smart pointer. More...

#include <Ref.hpp>

Public Member Functions

 Ref ()=default
 
 Ref (T *object)
 
 Ref (const Ref &other)
 
 Ref (Ref &&other) noexcept
 
 ~Ref ()
 
Ref< T > & operator= (const Ref &other)
 
Ref< T > & operator= (Ref &&other) noexcept
 
bool operator== (const Ref &other) const
 
bool operator!= (const Ref &other) const
 
bool IsNull () const
 
bool IsNotNull () const
 
Toperator-> () const
 
Toperator* () const
 
 operator bool () const
 
void Reset (T *ptr=nullptr)
 
bool IsUnique () const
 
TRelease ()
 
TGet () const
 
template<typename G >
bool Is () const
 
template<class G >
Ref< GAs () const
 
template<class G >
Ref< GCast () const
 
template<class G >
Ref< GForceCast () const
 

Detailed Description

template<typename T>
class Ref< T >

Automates reference counting and behaves as shared smart pointer.

Template Parameters
TType referenced object

Constructor & Destructor Documentation

◆ Ref() [1/4]

template<typename T >
Ref< T >::Ref ( )
default

◆ Ref() [2/4]

template<typename T >
Ref< T >::Ref ( T object)
inlineexplicit

◆ Ref() [3/4]

template<typename T >
Ref< T >::Ref ( const Ref< T > &  other)
inline

◆ Ref() [4/4]

template<typename T >
Ref< T >::Ref ( Ref< T > &&  other)
inlinenoexcept

◆ ~Ref()

template<typename T >
Ref< T >::~Ref ( )
inline

Member Function Documentation

◆ As()

template<typename T >
template<class G >
Ref<G> Ref< T >::As ( ) const
inline

◆ Cast()

template<typename T >
template<class G >
Ref<G> Ref< T >::Cast ( ) const
inline

◆ ForceCast()

template<typename T >
template<class G >
Ref<G> Ref< T >::ForceCast ( ) const
inline

◆ Get()

template<typename T >
T* Ref< T >::Get ( ) const
inline

◆ Is()

template<typename T >
template<typename G >
bool Ref< T >::Is ( ) const
inline

◆ IsNotNull()

template<typename T >
bool Ref< T >::IsNotNull ( ) const
inline

◆ IsNull()

template<typename T >
bool Ref< T >::IsNull ( ) const
inline

◆ IsUnique()

template<typename T >
bool Ref< T >::IsUnique ( ) const
inline
Returns
For non-null ref true, if this is unique reference

◆ operator bool()

template<typename T >
Ref< T >::operator bool ( ) const
inlineexplicit

◆ operator!=()

template<typename T >
bool Ref< T >::operator!= ( const Ref< T > &  other) const
inline

◆ operator*()

template<typename T >
T& Ref< T >::operator* ( ) const
inline

◆ operator->()

template<typename T >
T* Ref< T >::operator-> ( ) const
inline

◆ operator=() [1/2]

template<typename T >
Ref<T>& Ref< T >::operator= ( const Ref< T > &  other)
inline

◆ operator=() [2/2]

template<typename T >
Ref<T>& Ref< T >::operator= ( Ref< T > &&  other)
inlinenoexcept

◆ operator==()

template<typename T >
bool Ref< T >::operator== ( const Ref< T > &  other) const
inline

◆ Release()

template<typename T >
T* Ref< T >::Release ( )
inline

◆ Reset()

template<typename T >
void Ref< T >::Reset ( T ptr = nullptr)
inline

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