Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

MemoryReference< T > Class Template Reference

#include <allocatingpointer.h>

Inheritance diagram for MemoryReference< T >:

Inheritance graph
[legend]
Collaboration diagram for MemoryReference< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class MemoryReference< T >

Keeps track of at most one pointer, deleting it when this object is destroyed.

Essentially, this class peforms simple single-use garbage collection. In general, an AllocatingPointer is more useful, but this class is required in some cases. Specifically, this class can handle objects of an unknown derived type, even if the type does not support a clone() operation (e.g. the standard numeric or string types.) It does so by sacrificing the ability to copy the pointed-to object; the copy simply has no pointer at all.

Definition at line 187 of file allocatingpointer.h.

Public Methods

 MemoryReference (T *pointer=0)
 Constructor; accepts 0 or a pointer to an object for which we are responsible.

 MemoryReference (const MemoryReference &)
 Copy constructor; does not copy pointer.

selfoperator= (const MemoryReference &)
 Copy assignment; does not copy pointer.


The documentation for this class was generated from the following file:
Generated on Mon Jan 20 02:37:05 2003 for RF-LISSOM by doxygen1.3-rc2