General KERNEL Documentation     End User KERNEL Services  


PROTECTED_DELETE Class Reference

#include <BasicsGenericDestructor.hxx>

Inheritance diagram for PROTECTED_DELETE:

Inheritance graph
Collaboration diagram for PROTECTED_DELETE:

Collaboration graph

Static Public Member Functions

static void deleteInstance (PROTECTED_DELETE *anObject)
static void addObj (PROTECTED_DELETE *anObject)

Protected Member Functions

virtual ~PROTECTED_DELETE ()

Static Protected Attributes

static std::list< PROTECTED_DELETE * > _objList

Static Private Attributes

static pthread_mutex_t _listMutex = PTHREAD_MUTEX_INITIALIZER

Detailed Description

The PROTECTED_DELETE base class provides a protected destructor. The only way to use PROTECTED_DELETE is inheritance: example: class LocalTraceBufferPool : public PROTECTED_DELETE Herited class destructor must stay protected. Normal use is:

This class is utilised with GENERIC_DESTRUCTOR and DESTRUCTOR_OF, to program automatic deletion of objects at the end of the process, while keeping the possibility of an early destruction, if required. This is used for unit testing and trace mecanism.


Constructor & Destructor Documentation

PROTECTED_DELETE::~PROTECTED_DELETE  )  [protected, virtual]
 

Herited classes have there own destructors


Member Function Documentation

void PROTECTED_DELETE::deleteInstance PROTECTED_DELETE anObject  )  [static]
 

deleteInstance deletes only once the object. Only object present on the static list of PROTECTED_DELETE* are deleted, then removed of the list. The operation is protected by a mutex.

void PROTECTED_DELETE::addObj PROTECTED_DELETE anObject  )  [static]
 

To allow a further destruction of a PRTECTED_DELETE object, it must be added to the static list of PROTECTED_DELETE*


Field Documentation

std::list< PROTECTED_DELETE * > PROTECTED_DELETE::_objList [static, protected]
 

pthread_mutex_t PROTECTED_DELETE::_listMutex = PTHREAD_MUTEX_INITIALIZER [static, private]