#include <frePointerSentry.h>
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 |
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.
| 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.
| 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.
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().
1.5.3 written by Dimitri van Heesch,
© 1997-2000