Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

wrap_ptr Template Class Reference

Constructor for pointers (like void *) doesn't properly 0 memory. More...

#include <type_allocator.h>

List of all members.

Public Methods

 wrap_ptr (const T *p=0)
 Default constructor is 0 pointer. More...

 wrap_ptr (const wrap_ptr<T>& w)
 Create wrapped ptr from a wrapped pointer. More...

wrap_ptr<T>& operator= (const wrap_ptr<T>& w)
 Make two objects equal.

 ~wrap_ptr ()
 Object does not own memory.

void destroy_obj ()
 Object does not own memory.

 operator const T * () const
 Cast operator to void * pointer. More...

 operator T * ()

Friends

int operator== (const wrap_ptr<T>& a, const wrap_ptr<T>& b)
 Equality operator. More...


Detailed Description

template<class T> template class wrap_ptr

Constructor for pointers (like void *) doesn't properly 0 memory.

This class wraps T * but 0 memory. Useful for arrays (because allocated memory needs to be 0). Not required if just a regular list.


Constructor & Destructor Documentation

template<classT>
wrap_ptr<T>::wrap_ptr<T> ( const T * p = 0 )
 

Default constructor is 0 pointer.

Parameters:
p   pointer to wrap.

template<classT>
wrap_ptr<T>::wrap_ptr<T> ( const wrap_ptr< T >& w ) [inline]
 

Create wrapped ptr from a wrapped pointer.

Parameters:
w   wrapped ptr.


Member Function Documentation

template<classT>
wrap_ptr<T>::operator const T * ( ) const [inline]
 

Cast operator to void * pointer.

Returns:
ptr.

template<classT>
wrap_ptr<T>::operator T * ( ) [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


Friends And Related Function Documentation

template<classT>
int operator== ( const wrap_ptr< T >& a,
const wrap_ptr< T >& b ) [friend]
 

Equality operator.

Pointers must be equal.


The documentation for this class was generated from the following file:
Generated at Wed Mar 2 11:19:03 2005 for Result Library by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000