DWFCore::DWFCountedObject Class Reference

#include "dwfcore/CountedObject.h"

Inheritance diagram for DWFCore::DWFCountedObject:

Inheritance graph
[legend]
Collaboration diagram for DWFCore::DWFCountedObject:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for reference counted objects.

Since:
1.0.1
This class provides reference count tracking and atomic modification operations. It does not manage the object itself; that is, the object will not self-delete, via this base class, when it's internal count reaches zero.

Definition at line 48 of file CountedObject.h.

Public Member Functions

_DWFCORE_API DWFCountedObject (int nInitialCount=0) throw ()
virtual _DWFCORE_API ~DWFCountedObject () throw ()
_DWFCORE_API DWFCountedObject (const DWFCountedObject &rSrc) throw ()
_DWFCORE_API DWFCountedObjectoperator= (const DWFCountedObject &rSrc) throw ()
_DWFCORE_API int count () const throw ()
virtual _DWFCORE_API void increment () const throw ()
virtual _DWFCORE_API void decrement () const throw ()
virtual _DWFCORE_API void destroy ()


Constructor & Destructor Documentation

_DWFCORE_API DWFCore::DWFCountedObject::DWFCountedObject int  nInitialCount = 0  )  throw () [inline]
 

Constructor

Parameters:
nInitialCount The starting reference count, default is zero.
Exceptions:
None 

Definition at line 60 of file CountedObject.h.

virtual _DWFCORE_API DWFCore::DWFCountedObject::~DWFCountedObject  )  throw () [inline, virtual]
 

Destructor

Exceptions:
None 

Definition at line 71 of file CountedObject.h.

_DWFCORE_API DWFCore::DWFCountedObject::DWFCountedObject const DWFCountedObject rSrc  )  throw () [inline]
 

Copy Constructor

Exceptions:
None 

Definition at line 81 of file CountedObject.h.


Member Function Documentation

_DWFCORE_API int DWFCore::DWFCountedObject::count  )  const throw () [inline]
 

Returns the number of references on this object. This call is not thread-safe nor otherwise synchronized with increment() and decrement().

Returns:
The current reference count.
Exceptions:
None 

Definition at line 108 of file CountedObject.h.

virtual _DWFCORE_API void DWFCore::DWFCountedObject::decrement  )  const throw () [inline, virtual]
 

Atomically decrease the reference count by one. No special behavior is implied when the count reaches zero. This object will not auto-delete.

Exceptions:
None 

Definition at line 134 of file CountedObject.h.

virtual _DWFCORE_API void DWFCore::DWFCountedObject::destroy  )  [inline, virtual]
 

Invoked to have the object delete itself. This method may be overridden to alter the deletion itself or perform pre/post deletion work. This method uses the DWFCORE_FREE_OBJECT macro to delete itself so objects of this type should be allocated with the DWFCORE_ALLOC_OBJECT macro. If another allocator is used, this method should be implemented in the derived class using a matching deallocator.

Exceptions:
None 

Definition at line 153 of file CountedObject.h.

virtual _DWFCORE_API void DWFCore::DWFCountedObject::increment  )  const throw () [inline, virtual]
 

Atomically increase the reference count by one.

Exceptions:
None 

Definition at line 120 of file CountedObject.h.

_DWFCORE_API DWFCountedObject& DWFCore::DWFCountedObject::operator= const DWFCountedObject rSrc  )  throw () [inline]
 

Assignment Operator

Exceptions:
None 

Definition at line 92 of file CountedObject.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:39:35 2009 for Autodesk DWF Core Library by  doxygen 1.4.5