Blender V2.61 - r43446
Public Member Functions | Protected Member Functions | Protected Attributes

MEM_RefCounted Class Reference

#include <MEM_RefCounted.h>

List of all members.

Public Member Functions

 MEM_RefCounted ()
virtual int getRef () const
virtual int incRef ()
virtual int decRef ()

Protected Member Functions

virtual ~MEM_RefCounted ()

Protected Attributes

int m_refCount
 The reference count.

Detailed Description

An object with reference counting. Base class for objects with reference counting. When a shared object is ceated, it has reference count == 1. If the the reference count of a shared object reaches zero, the object self-destructs. The default destructor of this object has been made protected on purpose. This disables the creation of shared objects on the stack.

Author:
Maarten Gribnau
Date:
March 31, 2001

Definition at line 52 of file MEM_RefCounted.h.


Constructor & Destructor Documentation

MEM_RefCounted::MEM_RefCounted ( ) [inline]

Constructs a a shared object.

Definition at line 57 of file MEM_RefCounted.h.

virtual MEM_RefCounted::~MEM_RefCounted ( ) [inline, protected, virtual]

Destructs a shared object. The destructor is protected to force the use of incRef and decRef.

Definition at line 85 of file MEM_RefCounted.h.


Member Function Documentation

int MEM_RefCounted::decRef ( ) [inline, virtual]

Decreases the reference count of this object. If the the reference count reaches zero, the object self-destructs.

Returns:
the new reference count.

Definition at line 105 of file MEM_RefCounted.h.

References m_refCount.

int MEM_RefCounted::getRef ( ) const [inline, virtual]

Returns the reference count of this object.

Returns:
the reference count.

Definition at line 95 of file MEM_RefCounted.h.

References m_refCount.

int MEM_RefCounted::incRef ( ) [inline, virtual]

Increases the reference count of this object.

Returns:
the new reference count.

Definition at line 100 of file MEM_RefCounted.h.

References m_refCount.


Member Data Documentation

int MEM_RefCounted::m_refCount [protected]

The reference count.

Definition at line 91 of file MEM_RefCounted.h.

Referenced by decRef(), getRef(), and incRef().


The documentation for this class was generated from the following file: