Package: Utilities        GrAL: Packages | Concepts | Homepage

Generator functions for ref_ptr
[Memory management and smart pointers]

Collaboration diagram for Generator functions for ref_ptr:

Functions

template<class T >
ref_ptr< T > GrAL::new_ref_ptr (T *t)
 Convert newly allocated pointer to ref_ptr.
template<class T >
ref_ptr< T > GrAL::ref_ptr::copy_to_ref_ptr (T const &t)
 Copy t to a ref_ptr.
template<class T >
ref_ptr< const T > GrAL::ref_ptr::copy_to_const_ref_ptr (T const &t)
 Copy t to a const ref_ptr.
template<class T >
ref_ptr< T > GrAL::ref_ptr::ref_to_ref_ptr (T &t)
 Reference t in a ref_ptr (no ownership transfer).
template<class T >
ref_ptr< const T > GrAL::ref_ptr::const_ref_to_ref_ptr (T const &t)
 Reference t in a ref_ptr (no ownership transfer).

Detailed Description

These generator functions make it easier/more convenient to generate a ref_ptr

Function Documentation

template<class T >
ref_ptr<T> GrAL::new_ref_ptr ( T *  t  )  [inline]

Convert newly allocated pointer to ref_ptr.

It is assumed that t is newly allocated, and no delete is called. Example:

      {
      // ...
      ref_ptr<MyClass> r = new_ref_ptr(new MyClass(myargs));
      return r;
      // note: Ownership is taken by r.
      }

Definition at line 430 of file ref-ptr.h.

template<class T >
ref_ptr< T > copy_to_ref_ptr ( T const &  t  )  [related, inherited]

Copy t to a ref_ptr.

The contents of the result will be writeable.

Definition at line 411 of file ref-ptr.h.

template<class T >
ref_ptr< const T > copy_to_const_ref_ptr ( T const &  t  )  [related, inherited]

Copy t to a const ref_ptr.

The contents of the results will not be writeable

Definition at line 446 of file ref-ptr.h.


©  Guntram Berti 1997-2009. See the GrAL Homepage for up-to-date information.

Generated on Tue Mar 31 18:53:11 2009 for Utilities by doxygen 1.5.8