L4Re - L4 Runtime Environment
|
Smart pointer with automatic deletion. More...
Public Types | |
typedef T | Ref_type |
The referenced type. More... | |
Public Member Functions | |
Auto_ptr (T *p=0) throw () | |
Construction by assignment of a normal pointer. More... | |
Auto_ptr (Auto_ptr const &o) throw () | |
Copy construction, releases the original pointer. More... | |
Auto_ptr & | operator= (Auto_ptr const &o) throw () |
Assignment from another smart pointer. More... | |
~Auto_ptr () throw () | |
Destruction, shall delete the object. More... | |
T & | operator* () const throw () |
Dereference the pointer. More... | |
T * | operator-> () const throw () |
Member access for the object. More... | |
T * | get () const throw () |
Get the normal pointer. More... | |
T * | release () throw () |
Release the object and get the normal pointer back. More... | |
void | reset (T *p=0) throw () |
Delete the object and reset the smart pointer to NULL. | |
operator Priv_type * () const throw () | |
Operator for if (!ptr) ... . More... | |
Smart pointer with automatic deletion.
T | The type of the referenced object. |
This smart pointer calls the delete operator when the destructor is called. This has the effect that the object the pointer points to will be deleted when the pointer goes out of scope, or a new value gets assigned. The smart pointer provides a release() method to get a normal pointer to the object and set the smart pointer to NULL.
typedef T cxx::Auto_ptr< T >::Ref_type |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assignment from another smart pointer.
o | The source for the assignment (will be released). |
Definition at line 65 of file auto_ptr.
References cxx::Auto_ptr< T >::release().
|
inline |
Release the object and get the normal pointer back.
After calling this function the smart pointer will point to NULL and the object will not be deleted by the pointer anymore.
Definition at line 98 of file auto_ptr.
Referenced by cxx::Auto_ptr< T >::operator=().