U3D
Open-source, cross-platform 2D and 3D game engine built in C++
|
Unique pointer template class. More...
#include </var/dev/u3d/stable/Source/Urho3D/Container/Ptr.h>
Public Member Functions | |
UniquePtr () | |
Construct empty. | |
UniquePtr (T *ptr) | |
Construct from pointer. | |
UniquePtr (const UniquePtr &)=delete | |
Prevent copy construction. | |
UniquePtr & | operator= (const UniquePtr &)=delete |
Prevent assignment. | |
UniquePtr & | operator= (T *ptr) |
Assign from pointer. | |
UniquePtr (std::nullptr_t) | |
Construct empty. | |
UniquePtr (UniquePtr &&up) noexcept | |
Move-construct from UniquePtr. | |
UniquePtr & | operator= (UniquePtr &&up) noexcept |
Move-assign from UniquePtr. | |
T * | operator-> () const |
Point to the object. | |
T & | operator* () const |
Dereference the object. | |
template<class U > | |
bool | operator< (const UniquePtr< U > &rhs) const |
Test for less than with another unique pointer. | |
template<class U > | |
bool | operator== (const UniquePtr< U > &rhs) const |
Test for equality with another unique pointer. | |
template<class U > | |
bool | operator!= (const UniquePtr< U > &rhs) const |
Test for inequality with another unique pointer. | |
operator bool () const | |
Cast pointer to bool. | |
void | Swap (UniquePtr &up) |
Swap with another UniquePtr. | |
T * | Detach () |
Detach pointer from UniquePtr without destroying. | |
bool | Null () const |
Check if the pointer is null. | |
bool | NotNull () const |
Check if the pointer is not null. | |
T * | Get () const |
Return the raw pointer. | |
void | Reset (T *ptr=nullptr) |
Reset. | |
unsigned | ToHash () const |
Return hash value for HashSet & HashMap. | |
~UniquePtr () | |
Destruct. | |
Private Attributes | |
T * | ptr_ {} |
Unique pointer template class.