libcommonc++
0.7
|
A non-copyable scoped pointer. More...
#include <ScopedPtr.h++>
Public Member Functions | |
ScopedPtr () | |
Construct a new, NULL ScopedPtr. More... | |
ScopedPtr (T *object) | |
Construct a new ScopedPtr for the given object pointer. More... | |
~ScopedPtr () | |
Destructor. More... | |
T & | operator* () const |
Dereference operator. More... | |
T * | operator-> () const |
Pointer-to-member operator. More... | |
void | reset (T *object=NULL) |
Reset the pointer. More... | |
T * | get () const |
Get the value of the pointer. More... | |
T * | release () |
Release ownership of the object. More... | |
bool | operator! () const |
Test if the pointer is NULL. More... | |
operator const void * () const | |
Boolean test operator. More... | |
bool | isNull () const |
Test if the pointer is NULL. More... | |
void | swap (ScopedPtr &other) |
Swap this pointer with another. More... | |
A non-copyable scoped pointer.
Maintains a pointer to another object, which is deleted automatically when the ScopedPtr itself is destroyed.
|
inline |
Destructor.
|
inline |
Get the value of the pointer.
|
inline |
Test if the pointer is NULL.
|
inline |
Boolean test operator.
(Test if the pointer is non-NULL.)
|
inline |
Test if the pointer is NULL.
|
inline |
Dereference operator.
NullPointerException | If this pointer is NULL. |
|
inline |
Pointer-to-member operator.
NullPointerException | If this pointer is NULL. |
|
inline |
Release ownership of the object.
|
inline |
Reset the pointer.
The old object, if any, is deleted.
|
inline |
Swap this pointer with another.