AgateLib.Utility.RefCounter< T > Class Template Reference

Class which implements a reference counter around a Disposable object. The object is disposed when the reference count drops to zero. This class should not be used directly, instead use the Ref<T> structure. More...

List of all members.

Public Member Functions

 RefCounter (T obj)
 Constructs a RefCounter object around the specified object.
void AddRef ()
 Increases the reference count.
void Dispose ()
 Decreases the reference count, and if it hits zero Dispose is called on the object.
int GetRefCount ()
 Returns the number of references. This is meant for debugging purposes only, do not write code which calls Dispose until GetRefCount drops to zero.

Properties

Value [get]
 Gets the object this is wrapped around.
bool IsDisposed [get]
 Returns true if the object has had its Dispose member called, and thus no more calls on that object should be made.


Detailed Description

template<T>
class AgateLib::Utility::RefCounter< T >

Class which implements a reference counter around a Disposable object. The object is disposed when the reference count drops to zero. This class should not be used directly, instead use the Ref<T> structure.

[Experimental - This class may disappear in the future.]

Template Parameters:
T 
Type Constraints
T :IDisposable 

Constructor & Destructor Documentation

template<T >
AgateLib.Utility.RefCounter< T >.RefCounter ( obj  ) 

Constructs a RefCounter object around the specified object.

Parameters:
obj 


Member Function Documentation

template<T >
void AgateLib.Utility.RefCounter< T >.AddRef (  ) 

Increases the reference count.

template<T >
void AgateLib.Utility.RefCounter< T >.Dispose (  ) 

Decreases the reference count, and if it hits zero Dispose is called on the object.

template<T >
int AgateLib.Utility.RefCounter< T >.GetRefCount (  ) 

Returns the number of references. This is meant for debugging purposes only, do not write code which calls Dispose until GetRefCount drops to zero.

Returns:


Property Documentation

template<T >
bool AgateLib.Utility.RefCounter< T >.IsDisposed [get]

Returns true if the object has had its Dispose member called, and thus no more calls on that object should be made.

template<T >
T AgateLib.Utility.RefCounter< T >.Value [get]

Gets the object this is wrapped around.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo