Zen
A cross-platform functional programming language

autoptr< T > Class Template Reference

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]

Constructor.

Parameters:
tInitial value

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:
tPointer to assign
T* reset ( T *  n) [inline]

Assign pointer and return pointer to old value.

Parameters:
nThe new pointer to accept
Returns:
Pointer to old value
T* take ( ) [inline]

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines