Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
RefCountedObject Class Referenceabstract

Base class for reference-counted objects. More...

#include <Workspace/Application/LanguageUtils/refcount.h>

Inherited by TemporaryDirectoryImpl.

Public Member Functions

void addRef ()
 
void removeRef ()
 

Protected Member Functions

 RefCountedObject ()
 
 RefCountedObject (const RefCountedObject &)
 
virtual ~RefCountedObject ()=0
 
RefCountedObjectoperator= (const RefCountedObject &rhs)
 

Detailed Description

Based on Item 29 in "More Effective C++", Scott Meyers.

Constructor & Destructor Documentation

◆ RefCountedObject() [1/2]

RefCountedObject ( )
inlineprotected

◆ RefCountedObject() [2/2]

RefCountedObject ( const RefCountedObject )
inlineprotected

◆ ~RefCountedObject()

~RefCountedObject ( )
inlineprotectedpure virtualdefault

Member Function Documentation

◆ addRef()

void addRef ( )
inline

Increments the reference count for this object.

◆ operator=()

RefCountedObject & operator= ( const RefCountedObject rhs)
inlineprotected
Parameters
rhsUnused.

The assignment operator is a no-op. It simply returns the current object unchanged. It is assumed that something else is in control of the reference count, such as RefCountedObjectPtr or RefCountedPtr. This is consistent with the constructors, which create the object with a zero reference count.

◆ removeRef()

void removeRef ( )
inline

Decrements the reference count for this object. If the reference count reduces to zero, the object is deleted.