HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UI_XPtr< T > Class Template Reference

#include <UI_XPtr.h>

Public Types

using PointerType = T *
 
using ElementType = T
 
using ThisType = UI_XPtr< T >
 

Public Member Functions

SYS_FORCE_INLINE UI_XPtr () noexcept=default
 
SYS_FORCE_INLINE UI_XPtr (T *ptr, bool owner) noexcept
 Construct via raw pointer with ownership flag. More...
 
 UI_XPtr (std::nullptr_t) noexcept
 Construct with nullptr. More...
 
SYS_FORCE_INLINE ~UI_XPtr ()
 
template<typename U >
SYS_FORCE_INLINE UI_XPtr (UI_XPtr< U > &&other) noexcept
 
template<typename U >
SYS_FORCE_INLINE UI_XPtroperator= (UI_XPtr< U > &&other) noexcept
 
 UI_XPtr (const ThisType &other)=delete
 
UI_XPtroperator= (const ThisType &other)=delete
 
UI_XPtroperator= (std::nullptr_t) noexcept
 Assign nullptr. More...
 
SYS_FORCE_INLINE bool operator== (const ThisType &other) const noexcept
 
SYS_FORCE_INLINE bool operator!= (const ThisType &other) const noexcept
 
SYS_FORCE_INLINE Toperator* () const noexcept
 
SYS_FORCE_INLINE Toperator-> () const noexcept
 
SYS_FORCE_INLINE Tget () const noexcept
 
SYS_FORCE_INLINE Trelease () noexcept
 
SYS_NO_DISCARD_RESULT ThisType ref () const noexcept
 Return an unowned reference to the underlying pointer. More...
 
SYS_FORCE_INLINE bool isOwner () const noexcept
 Determine if this is an owning pointer. More...
 
template<typename U >
SYS_FORCE_INLINE UI_XPtr< T > & operator= (UI_XPtr< U > &&other) noexcept
 
SYS_FORCE_INLINE operator bool () const noexcept
 
SYS_FORCE_INLINE operator bool () noexcept
 
SYS_FORCE_INLINE void reset () noexcept
 
SYS_FORCE_INLINE void reset (T *ptr, bool owner) noexcept
 
SYS_FORCE_INLINE void swap (ThisType &b) noexcept
 
SYS_FORCE_INLINE friend void swap (ThisType &a, ThisType &b) noexcept
 

Detailed Description

template<typename T>
class UI_XPtr< T >

Smart pointer class for holding UI_Look instances. Similar to a UT_UniquePtr, it additionally tracks whether its pointer is an owner or not.

Definition at line 27 of file UI_XPtr.h.

Member Typedef Documentation

template<typename T>
using UI_XPtr< T >::ElementType = T

Definition at line 31 of file UI_XPtr.h.

template<typename T>
using UI_XPtr< T >::PointerType = T*

Definition at line 30 of file UI_XPtr.h.

template<typename T>
using UI_XPtr< T >::ThisType = UI_XPtr<T>

Definition at line 32 of file UI_XPtr.h.

Constructor & Destructor Documentation

template<typename T>
SYS_FORCE_INLINE UI_XPtr< T >::UI_XPtr ( )
defaultnoexcept
template<typename T>
SYS_FORCE_INLINE UI_XPtr< T >::UI_XPtr ( T ptr,
bool  owner 
)
noexcept

Construct via raw pointer with ownership flag.

Definition at line 156 of file UI_XPtr.h.

template<typename T>
UI_XPtr< T >::UI_XPtr ( std::nullptr_t  )
inlinenoexcept

Construct with nullptr.

Definition at line 42 of file UI_XPtr.h.

template<typename T >
SYS_FORCE_INLINE UI_XPtr< T >::~UI_XPtr ( )

Definition at line 169 of file UI_XPtr.h.

template<typename T >
template<typename U >
SYS_FORCE_INLINE UI_XPtr< T >::UI_XPtr ( UI_XPtr< U > &&  other)
noexcept

Definition at line 178 of file UI_XPtr.h.

template<typename T>
UI_XPtr< T >::UI_XPtr ( const ThisType other)
delete

Member Function Documentation

template<typename T>
SYS_FORCE_INLINE T* UI_XPtr< T >::get ( ) const
inlinenoexcept

Definition at line 90 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE bool UI_XPtr< T >::isOwner ( ) const
inlinenoexcept

Determine if this is an owning pointer.

Definition at line 114 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE UI_XPtr< T >::operator bool ( ) const
inlineexplicitnoexcept

Explicit bool operator to avoid releasing the pointer with the cast operator. To do this, we must have both const and non-const versions.

Definition at line 70 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE UI_XPtr< T >::operator bool ( )
inlineexplicitnoexcept

Explicit bool operator to avoid releasing the pointer with the cast operator. To do this, we must have both const and non-const versions.

Definition at line 72 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE bool UI_XPtr< T >::operator!= ( const ThisType other) const
inlinenoexcept

Definition at line 80 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE T& UI_XPtr< T >::operator* ( ) const
inlinenoexcept

Definition at line 84 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE T* UI_XPtr< T >::operator-> ( ) const
inlinenoexcept

Definition at line 87 of file UI_XPtr.h.

template<typename T>
template<typename U >
SYS_FORCE_INLINE UI_XPtr& UI_XPtr< T >::operator= ( UI_XPtr< U > &&  other)
noexcept
template<typename T>
UI_XPtr& UI_XPtr< T >::operator= ( const ThisType other)
delete
template<typename T>
UI_XPtr& UI_XPtr< T >::operator= ( std::nullptr_t  )
inlinenoexcept

Assign nullptr.

Definition at line 60 of file UI_XPtr.h.

template<typename T>
template<typename U >
SYS_FORCE_INLINE UI_XPtr<T>& UI_XPtr< T >::operator= ( UI_XPtr< U > &&  other)
noexcept

Definition at line 189 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE bool UI_XPtr< T >::operator== ( const ThisType other) const
inlinenoexcept

Definition at line 76 of file UI_XPtr.h.

template<typename T>
SYS_NO_DISCARD_RESULT ThisType UI_XPtr< T >::ref ( ) const
inlinenoexcept

Return an unowned reference to the underlying pointer.

Definition at line 107 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE T* UI_XPtr< T >::release ( )
inlinenoexcept

Release ownership and return current value

Note
Unlike UT_UniquePtr, release() does not reset myPtr

Definition at line 95 of file UI_XPtr.h.

template<typename T >
SYS_FORCE_INLINE void UI_XPtr< T >::reset ( void  )
noexcept

Reset pointer to nullptr or to another raw pointer value

Definition at line 216 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE void UI_XPtr< T >::reset ( T ptr,
bool  owner 
)
noexcept

Reset pointer to nullptr or to another raw pointer value

Definition at line 227 of file UI_XPtr.h.

template<typename T>
SYS_FORCE_INLINE void UI_XPtr< T >::swap ( ThisType b)
inlinenoexcept

Swap with another instance

Definition at line 119 of file UI_XPtr.h.

Friends And Related Function Documentation

template<typename T>
SYS_FORCE_INLINE friend void swap ( ThisType a,
ThisType b 
)
friend

Swap with another instance

Definition at line 130 of file UI_XPtr.h.


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