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