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

IMG_MemPtr Class Template Reference

A memory pointer for memory of any type. More...

#include <IMG_MemPtr.h>

List of all members.

Public Methods

 IMG_MemPtr (size_t s)
 Constructs a memory pointer. More...

 IMG_MemPtr (void *p,size_t s)
 Constructs a memory pointer from a pointer. More...

 ~IMG_MemPtr ()
 Destructor.

 operator T * ()
 Access to the memory. More...


Public Attributes

T* m_p
 Pointer to the memory.

bool m_owned


Detailed Description

template<class T> class IMG_MemPtr

A memory pointer for memory of any type.

It can be used to avoid memory leaks when allocating memory in constructors.

Author(s):
Maarten Gribnau
Date:
March 8, 2001


Constructor & Destructor Documentation

template<class T>
IMG_MemPtr<T>::IMG_MemPtr<T> ( size_t s ) [inline]
 

Constructs a memory pointer.

Parameters:
s   requested size of the pointer
Exceptions:
Size   > when an invalid width and/or height is passed.
Memory   > when a there is not enough memory to allocate the image.

template<class T>
IMG_MemPtr<T>::IMG_MemPtr<T> ( void * p,
size_t s ) [inline]
 

Constructs a memory pointer from a pointer.

Parameters:
p   the pointer
s   requested size of the pointer
Exceptions:
Size   > when an invalid width and/or height is passed.


Member Function Documentation

template<class T>
IMG_MemPtr<T>::operator T * ( ) [inline]
 

Access to the memory.

Returns:
pointer to the memory


The documentation for this class was generated from the following file:
Generated at Thu May 3 17:29:38 2001 for ImgLib by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000