![]() |
Public API Reference |
![]() |
Smart pointer that deletes the contained pointer when the scope is exited. More...
#include <csutil/scopedpointer.h>
Public Member Functions | |
void | Invalidate () |
Invalidate (delete) the contained pointer. | |
bool | IsValid () const |
Check if the contained pointer is valid. | |
operator T * () const | |
Cast to a pointer. | |
T & | operator* () const |
Dereference underlying pointer. | |
T * | operator-> () const |
Dereference underlying pointer. | |
void | Reset (T *ptr=nullptr) |
Replace the contained pointer with another. | |
ScopedPointer (T *ptr=nullptr) | |
Construct from given pointer. | |
~ScopedPointer () | |
Destruct. Deletes the given pointer! |
Smart pointer that deletes the contained pointer when the scope is exited.
T | is the type pointed to. |
Definition at line 37 of file scopedpointer.h.
CS::Utility::ScopedPointer< T >::ScopedPointer | ( | T * | ptr = nullptr | ) | [inline] |
Construct from given pointer.
Definition at line 45 of file scopedpointer.h.
CS::Utility::ScopedPointer< T >::~ScopedPointer | ( | ) | [inline] |
Destruct. Deletes the given pointer!
Definition at line 47 of file scopedpointer.h.
void CS::Utility::ScopedPointer< T >::Invalidate | ( | ) | [inline] |
Invalidate (delete) the contained pointer.
Definition at line 59 of file scopedpointer.h.
bool CS::Utility::ScopedPointer< T >::IsValid | ( | ) | const [inline] |
Check if the contained pointer is valid.
Definition at line 61 of file scopedpointer.h.
CS::Utility::ScopedPointer< T >::operator T * | ( | ) | const [inline] |
Cast to a pointer.
Definition at line 68 of file scopedpointer.h.
T& CS::Utility::ScopedPointer< T >::operator* | ( | ) | const [inline] |
Dereference underlying pointer.
Definition at line 72 of file scopedpointer.h.
T* CS::Utility::ScopedPointer< T >::operator-> | ( | ) | const [inline] |
Dereference underlying pointer.
Definition at line 64 of file scopedpointer.h.
void CS::Utility::ScopedPointer< T >::Reset | ( | T * | ptr = nullptr | ) | [inline] |
Replace the contained pointer with another.
Definition at line 53 of file scopedpointer.h.