Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/util/UniquePtr.h>
Public Member Functions | |
UniquePtr (void) | |
UniquePtr (T *ptr) | |
UniquePtr (UniquePtr< T > &ptr) | |
~UniquePtr (void) | |
bool | isNull (void) const |
void | clean (void) |
T * | detach (void) |
void | set (T *ptr) |
T * | get (void) const |
UniquePtr< T > & | operator= (T *ptr) |
UniquePtr< T > & | operator= (UniquePtr< T > &ptr) |
operator T* (void) const | |
T * | operator-> (void) const |
operator bool (void) const | |
T & | operator* (void) const |
Implements a pointer wrapper class ensuring there is only one owner of a pointed object. When a unique pointer is deleted, the pointed object is also deleted while when a unique pointer is assigned to another one, it looses the pointed object that is passed to assigned unique pointer.
T | Type of pointed objects. |
|
inline |
Free the pointed memory and set the pointer to null.
Referenced by UniquePtr< elm::rtti::PointerType >::operator=(), UniquePtr< elm::rtti::PointerType >::set(), and UniquePtr< elm::rtti::PointerType >::~UniquePtr().
|
inline |
Return the pointer and set it in the object to null (it will no more be automatically fried).
|
inline |
Test if the pointer is null.
Referenced by UniquePtr< elm::rtti::PointerType >::operator bool().
|
inline |
Same as get().
References UniquePtr< T >::get().
|
inline |
|
inline |
Indirect access to the members of stored pointer.
|
inline |
Change the pointer contained in the unique pointer, the old pointer begin fried. Same as set().
ptr | Pointer to set. |
|
inline |
Referenced by UniquePtr< elm::rtti::PointerType >::operator=().