ML Reference
ml::RefCountedBase Class Reference

RefCountedBase class adds intrusive reference counting support to the Base class. More...

#include <mlRefCountedBase.h>

Inheritance diagram for ml::RefCountedBase:
ml::EventSource ml::Base

List of all members.

Public Member Functions

 RefCountedBase ()
 Constructor.
virtual void incRefCount () const
 Increase reference count.
virtual void decRefCount () const
 Decrease ref count (object will be deleted if ref count is decremented to 0)
virtual bool isRefCountedBase () const
 Returns if the instance is derived from RefCountedBase.

Static Public Member Functions

static void updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase)
 Helper method that handles inc/dec of ref count if base instances support it.

Protected Member Functions

virtual ~RefCountedBase ()
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h.

Protected Attributes

MLint32 _refCount
 Reference count.

Detailed Description

RefCountedBase class adds intrusive reference counting support to the Base class.

It should be used together with boost::intrusive_ptr and the ML_REFCOUNTED_PTR macro.

Definition at line 24 of file mlRefCountedBase.h.


Constructor & Destructor Documentation

ml::RefCountedBase::RefCountedBase ( )

Constructor.

virtual ml::RefCountedBase::~RefCountedBase ( ) [protected, virtual]

Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h.

Destructor.


Member Function Documentation

virtual void ml::RefCountedBase::decRefCount ( ) const [virtual]

Decrease ref count (object will be deleted if ref count is decremented to 0)

virtual void ml::RefCountedBase::incRefCount ( ) const [virtual]

Increase reference count.

virtual bool ml::RefCountedBase::isRefCountedBase ( ) const [inline, virtual]

Returns if the instance is derived from RefCountedBase.

Reimplemented from ml::Base.

Definition at line 37 of file mlRefCountedBase.h.

static void ml::RefCountedBase::updateReferenceCountingIfSupported ( Base oldValue,
Base newValue,
bool &  isRefCountedBase 
) [static]

Helper method that handles inc/dec of ref count if base instances support it.

It decrements the ref count of oldValue if supported and not NULL. It increments the ref count of newValue if supported and not NULL. isRefCountedBase must indicate if oldValue supported ref counting. isRefCountedBase will be set to true if the newValue supports ref counting.


Member Data Documentation

MLint32 ml::RefCountedBase::_refCount [mutable, protected]

Reference count.

Definition at line 55 of file mlRefCountedBase.h.


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