Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

OsclRefCounterMTDA< LockType > Class Template Reference
[OSCL Base]

#include <oscl_refcounter.h>

Inheritance diagram for OsclRefCounterMTDA< LockType >:

OsclRefCounter

Public Methods

 OsclRefCounterMTDA (OsclAny *p, OsclDestructDealloc *dealloc)
virtual ~OsclRefCounterMTDA ()
void addRef ()
void removeRef ()
uint32 getCount ()

Detailed Description

template<class LockType>
class OsclRefCounterMTDA< LockType >

Implementation of OsclRefCounterDA for multi-threaded use. A templated lock class must be specified.


Constructor & Destructor Documentation

template<class LockType>
OsclRefCounterMTDA< LockType >::OsclRefCounterMTDA OsclAny   p,
OsclDestructDealloc   dealloc
[inline]
 

Constructor Takes a pointer to the buffer to track, and a pointer to the deallocator object which will be used to delete the buffer.

When the reference count reaches zero, the buffer will be deleted by the deallocator. Also, the OsclRefCounter object (this) will self-destruct when the reference count is zero. In some cases the OsclRefCounter object will be part of the buffer being deleted. For such cases, the object pointer must be equal to the buffer pointer given at construction. If the object is not part of the buffer being deleted, it will self-destruct with a call to delete().

Parameters:
p  pointer to the buffer to track
dealloc  pointer to the deallocator to use when deleting the buffer

template<class LockType>
virtual OsclRefCounterMTDA< LockType >::~OsclRefCounterMTDA   [inline, virtual]
 

Destructor empty


Member Function Documentation

template<class LockType>
void OsclRefCounterMTDA< LockType >::addRef   [inline, virtual]
 

Add to the reference count

Implements OsclRefCounter.

template<class LockType>
uint32 OsclRefCounterMTDA< LockType >::getCount   [inline, virtual]
 

Gets the current number of references

Implements OsclRefCounter.

template<class LockType>
void OsclRefCounterMTDA< LockType >::removeRef   [inline, virtual]
 

Remove from the reference count

Implements OsclRefCounter.


The documentation for this class was generated from the following file:
OSCL API
Posting Version: OPENCORE_20090310