3#include <Foundation/Basics.h>
4#include <Foundation/Memory/Allocator.h>
14 PL_DECLARE_MEM_RELOCATABLE_TYPE();
71 explicit operator bool()
const;
83 bool operator!=(std::nullptr_t)
const;
84 bool operator<(std::nullptr_t)
const;
85 bool operator<=(std::nullptr_t)
const;
86 bool operator>(std::nullptr_t)
const;
87 bool operator>=(std::nullptr_t)
const;
93 T* m_pInstance =
nullptr;
97#include <Foundation/Types/Implementation/UniquePtr_inl.h>
Base class for all memory allocators.
Definition Allocator.h:23
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
void Clear()
Destroys the managed object and resets the unique ptr.
Definition UniquePtr_inl.h:108
T & operator*() const
Provides access to the managed object.
Definition UniquePtr_inl.h:120
plUniquePtr(plUniquePtr< U > &&other)
Move constructs a unique ptr from another. The other unique ptr will be empty afterwards to guarantee...
T * Release()
Releases the managed object without destroying it. The unique ptr will be empty afterwards.
Definition UniquePtr_inl.h:79
plUniquePtr(const plInternal::NewInstance< U > &instance)
Creates a unique ptr from a freshly created instance through PL_NEW or PL_DEFAULT_NEW.
~plUniquePtr()
Destroys the managed object using the stored allocator.
Definition UniquePtr_inl.h:38
plUniquePtr(U *pInstance, plAllocator *pAllocator)
Creates a unique ptr from a pointer and an allocator. The passed allocator will be used to destroy th...
T * operator->() const
Provides access to the managed object.
Definition UniquePtr_inl.h:126
plUniquePtr()
Creates an empty unique ptr.
bool operator==(const plUniquePtr< T > &rhs) const
Compares the unique ptr against another unique ptr.
Definition UniquePtr_inl.h:138
T * Borrow() const
Borrows the managed object. The unique ptr stays unmodified.
Definition UniquePtr_inl.h:102
plUniquePtr< T > & operator=(const plInternal::NewInstance< U > &instance)
Sets the unique ptr from a freshly created instance through PL_NEW or PL_DEFAULT_NEW.
plUniquePtr< T > & operator=(plUniquePtr< U > &&other)
Move assigns a unique ptr from another. The other unique ptr will be empty afterwards to guarantee th...
Definition Allocator_inl.h:18