Guiliani  Version 2.6 revision 7293 (documentation build 12)
NSmartPtr::RefCounted Class Reference

The reference counted pointer class used with SharedPtr. More...

#include <RefCounted.h>

Inheritance diagram for NSmartPtr::RefCounted:

Public Member Functions

 RefCounted ()
 Create RefCounted object. The reference count is initialized to 0.
 
virtual ~RefCounted ()
 Destroy reference counted object.
 
void AddRef ()
 Increase reference count.
 
eC_Int RefCount () const
 
void Release ()
 
bool Unique () const
 

Detailed Description

The reference counted pointer class used with SharedPtr.

The RefCounted class is used in conjunction with SharedPtr to implement reference counting and automatic deletion for user classes. Derive any other class from this one to add the reference counting methods. Objects of this class delete themselves when the reference count reaches zero.

Member Function Documentation

◆ RefCount()

eC_Int NSmartPtr::RefCounted::RefCount ( ) const
inline

Get the current reference count.

Returns
The current reference count for this object.
Note
In a multithreaded environment this method should be used with care, because the reference count may change at any time.

◆ Release()

void NSmartPtr::RefCounted::Release ( )
inline

Decrease reference count.

Note
pointee is deleted if the reference count is zero.

◆ Unique()

bool NSmartPtr::RefCounted::Unique ( ) const
inline

Check whether this instance is referenced once.

Returns
True if instance is referenced once, False if multiple references to this instance exist.
Note
In a multithreaded environment this method should be used with care, because the reference count may change at any time.

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