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

ixion::no_free_dynamic_ref Class Template Reference

#include <ixlib_garbage.hh>

Inheritance diagram for ixion::no_free_dynamic_ref::

ixion::ref_base List of all members.

Public Methods

 no_free_dynamic_ref (no_free_dynamic_ref const &src)
 no_free_dynamic_ref (reference_manager< T > &mgr, T *instance=NULL)
 ~no_free_dynamic_ref ()
no_free_dynamic_ref & operator= (no_free_dynamic_ref const &src)
no_free_dynamic_ref & operator= (T *ptr)
void release ()
void set (T *instance)
T * releaseFromGCArena ()

Protected Attributes

reference_manager< T > & Manager

Detailed Description

template<class T>
class ixion::no_free_dynamic_ref< T >

An object that acts like a reference-counted pointer to an object. However, the referenced object is not freed if the no_free_ref is the last reference to the object to go out of scope.

This is useful to pass objects allocated e.g. on the stack along inside ref's, while making sure they aren't freed. (which would most probably lead to disaster)

no_free_ref's are mostly a hack, but there are situations where you cannot avoid them. But even so, you should try not to use them where possible.

The corresponding reference_manager is identified explicitly.

Definition at line 326 of file ixlib_garbage.hh.


Constructor & Destructor Documentation

template<class T>
ixion::no_free_dynamic_ref< T >::no_free_dynamic_ref no_free_dynamic_ref< T > const &    src [inline]
 

Definition at line 331 of file ixlib_garbage.hh.

template<class T>
ixion::no_free_dynamic_ref< T >::no_free_dynamic_ref reference_manager< T > &    mgr,
T *    instance = NULL
[inline]
 

Definition at line 335 of file ixlib_garbage.hh.

template<class T>
ixion::no_free_dynamic_ref< T >::~no_free_dynamic_ref   [inline]
 

Definition at line 339 of file ixlib_garbage.hh.


Member Function Documentation

template<class T>
no_free_dynamic_ref& ixion::no_free_dynamic_ref< T >::operator= T *    ptr [inline]
 

Definition at line 348 of file ixlib_garbage.hh.

template<class T>
no_free_dynamic_ref& ixion::no_free_dynamic_ref< T >::operator= no_free_dynamic_ref< T > const &    src [inline]
 

Definition at line 344 of file ixlib_garbage.hh.

template<class T>
void ixion::no_free_dynamic_ref< T >::release   [inline]
 

Definition at line 354 of file ixlib_garbage.hh.

template<class T>
T* ixion::no_free_dynamic_ref< T >::releaseFromGCArena   [inline]
 

Definition at line 365 of file ixlib_garbage.hh.

template<class T>
void ixion::no_free_dynamic_ref< T >::set T *    instance [inline]
 

Definition at line 358 of file ixlib_garbage.hh.

Referenced by operator=().


Member Data Documentation

template<class T>
reference_manager<T>& ixion::no_free_dynamic_ref::Manager [protected]
 

Definition at line 328 of file ixlib_garbage.hh.


The documentation for this class was generated from the following file:
Generated on Wed Oct 31 17:12:25 2001 for ixlib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001