#include <NSXException.h>
_NSHandlers are installed via _NSAddHandler2() and removed via _NSRemoveHandler2 -- they maintain the setjmp context buffer and allow access to it later on down the call chain. The last NSHandler installed is removed from the thread and longjmp()'d to when a NSException is raised. If an exception is not raised, then the _NSHandler2 must be manually removed.
This class wraps _NSHandler2 into a scope-aware C++ class, allowing automated installation and removal (and avoiding the need for the NS_[VOID|VALUE]RETURN hack).
Definition at line 162 of file NSXException.h.
Public Methods | |
| AutoNSExceptionHandler () | |
| Constructor installs a local _NSHandler2. | |
| ~AutoNSExceptionHandler () | |
| Destructor removes the local _NSHandle2 if it wasn't already removed by an exception being raised. | |
| NSException * | localException () |
| Returns the ObjC NSException object that was raised. | |
|
|
Constructor installs a local _NSHandler2.
Definition at line 165 of file NSXException.h. |
|
|
Destructor removes the local _NSHandle2 if it wasn't already removed by an exception being raised.
Definition at line 172 of file NSXException.h. |
|
|
Returns the ObjC NSException object that was raised. Always use this to retrieve the exception object, as it notes an exception was raised and remembers not to try to remove the local handler it previously installed. Definition at line 182 of file NSXException.h. |
1.2.17