Poco::RefCountedObject Class Reference

#include <RefCountedObject.h>

Inheritance diagram for Poco::RefCountedObject:

Inheritance graph
[legend]
Collaboration diagram for Poco::RefCountedObject:

Collaboration graph
[legend]

Detailed Description

A base class for objects that employ reference counting based garbage collection.

Reference-counted objects inhibit construction by copying and assignment.

Definition at line 86 of file RefCountedObject.h.


Public Member Functions

 RefCountedObject ()
void duplicate () const
 Creates the RefCountedObject. The initial reference count is one.
void release () const
 Increments the object's reference count.
int referenceCount () const
 Decrements the object's reference count and deletes the object if the count reaches zero.

Protected Member Functions

virtual ~RefCountedObject ()
 Returns the reference count.

Private Member Functions

 RefCountedObject (const RefCountedObject &)
 Destroys the RefCountedObject.
RefCountedObjectoperator= (const RefCountedObject &)

Private Attributes

int _rc
FastMutex _rcMutex

Constructor & Destructor Documentation

Poco::RefCountedObject::RefCountedObject (  ) 

Definition at line 79 of file RefCountedObject.cpp.

Poco::RefCountedObject::~RefCountedObject (  )  [protected, virtual]

Returns the reference count.

Definition at line 84 of file RefCountedObject.cpp.

Poco::RefCountedObject::RefCountedObject ( const RefCountedObject  )  [private]

Destroys the RefCountedObject.


Member Function Documentation

void Poco::RefCountedObject::duplicate (  )  const

Creates the RefCountedObject. The initial reference count is one.

Definition at line 89 of file RefCountedObject.cpp.

References _rc, _rcMutex, Poco::FastMutex::lock(), and Poco::FastMutex::unlock().

void Poco::RefCountedObject::release (  )  const

Increments the object's reference count.

Definition at line 97 of file RefCountedObject.cpp.

References _rc, _rcMutex, Poco::FastMutex::lock(), and Poco::FastMutex::unlock().

int Poco::RefCountedObject::referenceCount (  )  const [inline]

Decrements the object's reference count and deletes the object if the count reaches zero.

Definition at line 125 of file RefCountedObject.h.

References _rc.

RefCountedObject& Poco::RefCountedObject::operator= ( const RefCountedObject  )  [private]


Field Documentation

int Poco::RefCountedObject::_rc [mutable, private]

Definition at line 117 of file RefCountedObject.h.

Referenced by duplicate(), referenceCount(), and release().

Definition at line 118 of file RefCountedObject.h.

Referenced by duplicate(), and release().


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

SourceForge.net Logo
Project space on SourceForge.net