spla
Public Member Functions | List of all members
spla::ref_ptr< T > Class Template Reference

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

#include <ref.hpp>

Public Member Functions

 ref_ptr ()=default
 
 ref_ptr (T *object)
 
 ref_ptr (const ref_ptr &other)
 
 ref_ptr (ref_ptr &&other) noexcept
 
 ~ref_ptr ()
 
ref_ptr< T > & operator= (const ref_ptr &other)
 
template<typename G >
ref_ptr< T > & operator= (const ref_ptr< G > &other)
 
ref_ptr< T > & operator= (ref_ptr &&other) noexcept
 
bool operator== (const ref_ptr &other) const
 
bool operator!= (const ref_ptr &other) const
 
bool is_null () const
 
bool is_not_null () const
 
T * operator-> () const
 
T & operator* () const
 
 operator bool () const
 
void acquire (T *safe_ref_ptr=nullptr)
 
void reset (T *ptr=nullptr)
 
T * release ()
 
T * get () const
 
T * ref_and_get ()
 
template<typename G >
bool is () const
 
template<class G >
ref_ptr< G > as () const
 
template<class G >
ref_ptr< G > cast_safe () const
 
template<class G >
ref_ptr< G > cast () const
 
template<class G >
ref_ptr< G > cast_static () const
 

Detailed Description

template<typename T>
class spla::ref_ptr< T >

Automates reference counting and behaves as shared smart pointer.

Note
Naming is similar to std shader pointer class
Template Parameters
TType referenced object

Constructor & Destructor Documentation

◆ ref_ptr() [1/4]

template<typename T >
spla::ref_ptr< T >::ref_ptr ( )
default

◆ ref_ptr() [2/4]

template<typename T >
spla::ref_ptr< T >::ref_ptr ( T *  object)
inlineexplicit

◆ ref_ptr() [3/4]

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

◆ ref_ptr() [4/4]

template<typename T >
spla::ref_ptr< T >::ref_ptr ( ref_ptr< T > &&  other)
inlinenoexcept

◆ ~ref_ptr()

template<typename T >
spla::ref_ptr< T >::~ref_ptr ( )
inline

Member Function Documentation

◆ acquire()

template<typename T >
void spla::ref_ptr< T >::acquire ( T *  safe_ref_ptr = nullptr)
inline

◆ as()

template<typename T >
template<class G >
ref_ptr<G> spla::ref_ptr< T >::as ( ) const
inline

◆ cast()

template<typename T >
template<class G >
ref_ptr<G> spla::ref_ptr< T >::cast ( ) const
inline

◆ cast_safe()

template<typename T >
template<class G >
ref_ptr<G> spla::ref_ptr< T >::cast_safe ( ) const
inline

◆ cast_static()

template<typename T >
template<class G >
ref_ptr<G> spla::ref_ptr< T >::cast_static ( ) const
inline

◆ get()

template<typename T >
T* spla::ref_ptr< T >::get ( ) const
inline

◆ is()

template<typename T >
template<typename G >
bool spla::ref_ptr< T >::is ( ) const
inline

◆ is_not_null()

template<typename T >
bool spla::ref_ptr< T >::is_not_null ( ) const
inline

◆ is_null()

template<typename T >
bool spla::ref_ptr< T >::is_null ( ) const
inline

◆ operator bool()

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

◆ operator!=()

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

◆ operator*()

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

◆ operator->()

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

◆ operator=() [1/3]

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

◆ operator=() [2/3]

template<typename T >
template<typename G >
ref_ptr<T>& spla::ref_ptr< T >::operator= ( const ref_ptr< G > &  other)
inline

◆ operator=() [3/3]

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

◆ operator==()

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

◆ ref_and_get()

template<typename T >
T* spla::ref_ptr< T >::ref_and_get ( )
inline

◆ release()

template<typename T >
T* spla::ref_ptr< T >::release ( )
inline

◆ reset()

template<typename T >
void spla::ref_ptr< T >::reset ( T *  ptr = nullptr)
inline

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