FREE::PointerSentry Class Reference

Class ensures delet of allocated objects when exception is raised... More...

#include <frePointerSentry.h>

List of all members.

Public Member Functions

virtual const char * GetNameOfClass () const
void Deactivate ()
 PointerSentry (void *pGuardedObject, const bool bSuppressException=false)
 ~PointerSentry ()

Private Attributes

void * m_pGuardedObject
bool m_bSuppressException


Detailed Description

Class ensures delet of allocated objects when exception is raised...

PointerSentry is used in code regions where an unhandled exception could appear and in this case the deletion of an allocated object guaranteed. The passed object will be deleted, within the destructor of PointerSentry, so when we leave the function scope.

Definition at line 38 of file frePointerSentry.h.


Constructor & Destructor Documentation

FREE::PointerSentry::PointerSentry ( void *  pGuardedObject,
const bool  bSuppressException = false 
)

Default constructor

Definition at line 31 of file frePointerSentry.cxx.

References m_bSuppressException, and m_pGuardedObject.

FREE::PointerSentry::~PointerSentry (  ) 

destructor

Definition at line 39 of file frePointerSentry.cxx.

References m_bSuppressException, m_pGuardedObject, and throwExceptionMacro.


Member Function Documentation

virtual const char* FREE::PointerSentry::GetNameOfClass (  )  const [inline, virtual]

Definition at line 41 of file frePointerSentry.h.

void FREE::PointerSentry::Deactivate (  )  [inline]

Calling this function deactivates the Sentry. A deactivated sentry won't deallocate the guarded object.

Definition at line 45 of file frePointerSentry.h.

References m_pGuardedObject.


Member Data Documentation

void* FREE::PointerSentry::m_pGuardedObject [private]

Pointer to the guarded object

Definition at line 58 of file frePointerSentry.h.

Referenced by Deactivate(), PointerSentry(), and ~PointerSentry().

bool FREE::PointerSentry::m_bSuppressException [private]

Indicates if exception should be supressed, if object became deleted by the sentry

Definition at line 60 of file frePointerSentry.h.

Referenced by PointerSentry(), and ~PointerSentry().


The documentation for this class was generated from the following files:
Generated at Sat Oct 13 18:17:27 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000