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

OsclRefCounterMTSA< DeallocType, LockType > Class Template Reference
[OSCL Base]

#include <oscl_refcounter.h>

Inheritance diagram for OsclRefCounterMTSA< DeallocType, LockType >:

OsclRefCounter

Public Methods

 OsclRefCounterMTSA (OsclAny *p)
virtual ~OsclRefCounterMTSA ()
void addRef ()
void removeRef ()
uint32 getCount ()

Detailed Description

template<class DeallocType, class LockType>
class OsclRefCounterMTSA< DeallocType, LockType >

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


Constructor & Destructor Documentation

template<class DeallocType, class LockType>
OsclRefCounterMTSA< DeallocType, LockType >::OsclRefCounterMTSA OsclAny   p [inline]
 

Constructor Takes a pointer to the buffer to track.

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

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

Destructor empty


Member Function Documentation

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

Add to the reference count

Implements OsclRefCounter.

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

Gets the current number of references

Implements OsclRefCounter.

template<class DeallocType, class LockType>
void OsclRefCounterMTSA< DeallocType, 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