Hubris Engine Dev
A Project to learn and get into Game Engine developement.
 
Loading...
Searching...
No Matches
Hubris::Shared< T > Struct Template Reference

#include <Memory.h>

Public Types

using Unqualified = std::remove_cv_t<T>
 

Public Member Functions

constexpr Shared () noexcept=default
 
template<typename ... Args>
constexpr Shared (Args &&...args)
 
constexpr Shared (Weak< T > &&promote) noexcept
 
template<typename U>
requires PolymorphicConvertible<U, T>
constexpr Shared (const Shared< U > &other) noexcept
 
template<typename U>
requires PolymorphicConvertible<U, T>
Sharedoperator= (const Shared< U > &cpy) noexcept
 
template<typename U>
requires PolymorphicConvertible<U, T>
constexpr Shared (Shared< U > &&other) noexcept
 
template<typename U>
requires PolymorphicConvertible<U, T>
Sharedoperator= (Shared< U > &&mv) noexcept
 
 ~Shared () noexcept
 
void Release ()
 
constexpr T * get () noexcept
 
const T * get () const noexcept
 
T * operator-> ()
 Unchecked Operation: This is dangerous if the control block is null. That happens only when the Shared has been created using the default constructor.
 
const T * operator-> () const
 
T & operator* ()
 
const T & operator* () const
 
uint_fast32_t UseCount () const noexcept
 
bool Constructed () const noexcept
 returns true if the control block has been created
 
 operator bool ()
 
template<typename U>
requires PolymorphicConvertible<U, T>
constexpr void swap (Shared< U > &rhs) noexcept
 

Public Attributes

friend Weak< T >
 
friend Handle< T >
 

Detailed Description

template<typename T>
requires IsType<T>
struct Hubris::Shared< T >

Definition at line 240 of file Memory.h.

Member Typedef Documentation

◆ Unqualified

template<typename T>
using Hubris::Shared< T >::Unqualified = std::remove_cv_t<T>

Definition at line 242 of file Memory.h.

Constructor & Destructor Documentation

◆ Shared() [1/5]

template<typename T>
Hubris::Shared< T >::Shared ( )
constexprdefaultnoexcept

◆ Shared() [2/5]

template<typename T>
template<typename ... Args>
Hubris::Shared< T >::Shared ( Args &&... args)
inlineconstexpr

Definition at line 272 of file Memory.h.

+ Here is the call graph for this function:

◆ Shared() [3/5]

template<typename T>
Hubris::Shared< T >::Shared ( Weak< T > && promote)
inlineexplicitconstexprnoexcept

Definition at line 277 of file Memory.h.

◆ Shared() [4/5]

template<typename T>
template<typename U>
requires PolymorphicConvertible<U, T>
Hubris::Shared< T >::Shared ( const Shared< U > & other)
inlineexplicitconstexprnoexcept

Definition at line 285 of file Memory.h.

◆ Shared() [5/5]

template<typename T>
template<typename U>
requires PolymorphicConvertible<U, T>
Hubris::Shared< T >::Shared ( Shared< U > && other)
inlineexplicitconstexprnoexcept

Definition at line 314 of file Memory.h.

◆ ~Shared()

template<typename T>
Hubris::Shared< T >::~Shared ( )
inlinenoexcept

Definition at line 338 of file Memory.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ Constructed()

template<typename T>
bool Hubris::Shared< T >::Constructed ( ) const
inlinenoexcept

returns true if the control block has been created

or else returns false this Shared has no control block, should not use before initialization (or swapping with another valid Shared)

Definition at line 388 of file Memory.h.

◆ get() [1/2]

template<typename T>
const T * Hubris::Shared< T >::get ( ) const
inlinenoexcept

Definition at line 363 of file Memory.h.

◆ get() [2/2]

template<typename T>
T * Hubris::Shared< T >::get ( )
inlineconstexprnoexcept

Definition at line 362 of file Memory.h.

◆ operator bool()

template<typename T>
Hubris::Shared< T >::operator bool ( )
inline

Definition at line 390 of file Memory.h.

◆ operator*() [1/2]

template<typename T>
T & Hubris::Shared< T >::operator* ( )
inline

Definition at line 378 of file Memory.h.

◆ operator*() [2/2]

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

Definition at line 379 of file Memory.h.

◆ operator->() [1/2]

template<typename T>
T * Hubris::Shared< T >::operator-> ( )
inline

Unchecked Operation: This is dangerous if the control block is null. That happens only when the Shared has been created using the default constructor.

Returns
T* The object managed by this structure.

Definition at line 371 of file Memory.h.

◆ operator->() [2/2]

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

Definition at line 374 of file Memory.h.

◆ operator=() [1/2]

template<typename T>
template<typename U>
requires PolymorphicConvertible<U, T>
Shared & Hubris::Shared< T >::operator= ( const Shared< U > & cpy)
inlinenoexcept

Definition at line 297 of file Memory.h.

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T>
template<typename U>
requires PolymorphicConvertible<U, T>
Shared & Hubris::Shared< T >::operator= ( Shared< U > && mv)
inlinenoexcept

Definition at line 325 of file Memory.h.

+ Here is the call graph for this function:

◆ Release()

template<typename T>
void Hubris::Shared< T >::Release ( )
inline

Definition at line 343 of file Memory.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swap()

template<typename T>
template<typename U>
requires PolymorphicConvertible<U, T>
void Hubris::Shared< T >::swap ( Shared< U > & rhs)
inlineconstexprnoexcept

Definition at line 395 of file Memory.h.

◆ UseCount()

template<typename T>
uint_fast32_t Hubris::Shared< T >::UseCount ( ) const
inlinenoexcept

Definition at line 381 of file Memory.h.

Member Data Documentation

◆ Handle< T >

template<typename T>
friend Hubris::Shared< T >::Handle< T >

Definition at line 406 of file Memory.h.

◆ Weak< T >

template<typename T>
friend Hubris::Shared< T >::Weak< T >

Definition at line 405 of file Memory.h.


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