Auto pointer type.
More...
#include <zbl.hpp>
List of all members.
Public Member Functions |
|
| autoptr () |
| | Default constructor.
|
| | autoptr (T *t) |
| | Constructor.
|
|
| ~autoptr () |
| | Destructor.
|
| void | operator= (T *t) |
| | Assign pointer.
|
| T & | operator* () const |
| | Return reference to pointed value.
|
| T * | operator-> () const |
| | Return pointer to pointed value.
|
| T * | data () const |
| | Return pointer to pointed value.
|
| bool | isNull () const |
| | Check if valid pointer is assigned.
|
| T * | take () |
| | Return pointer to pointed value, and set value to 0.
|
| T * | reset (T *n) |
| | Assign pointer and return pointer to old value.
|
Private Attributes |
|
T * | _ptr |
| | The pointer.
|
Detailed Description
template<typename T>
class z::autoptr< T >
Auto pointer type.
- Todo:
- Merge autoptr with scopedptr
Constructor & Destructor Documentation
| autoptr |
( |
T * |
t | ) |
[inline, explicit] |
Member Function Documentation
| T* data |
( |
| ) |
const [inline] |
Return pointer to pointed value.
- Returns:
- Pointer to pointed value
| bool isNull |
( |
| ) |
const [inline] |
Check if valid pointer is assigned.
- Returns:
- True if valid pointer is assigned
| T& operator* |
( |
| ) |
const [inline] |
Return reference to pointed value.
- Returns:
- Reference to pointed value
| T* operator-> |
( |
| ) |
const [inline] |
Return pointer to pointed value.
- Returns:
- Pointer to pointed value
| void operator= |
( |
T * |
t | ) |
[inline] |
Assign pointer.
- Parameters:
-
| T* reset |
( |
T * |
n | ) |
[inline] |
Assign pointer and return pointer to old value.
- Parameters:
-
| n | The new pointer to accept |
- Returns:
- Pointer to old value
Return pointer to pointed value, and set value to 0.
- Returns:
- Pointer to pointed value
The documentation for this class was generated from the following file:
- /home/renji/Data/projects/zenlang/sources/zbl/zbl.hpp