Autowiring
1.0.3
A C++ Inversion of Control Framework
|
Implements an exception filter type, invoked when an unhandled exception is thrown More...
#include <ExceptionFilter.h>
Public Member Functions | |
virtual void | Filter (void) |
This method is invoked when an exception has been thrown by CoreThread::Run More... | |
virtual void | Filter (const JunctionBoxBase *pJunctionBox, CoreObject *pRecipient) |
This is an exception filter for exceptions thrown during a call to Fire More... | |
Implements an exception filter type, invoked when an unhandled exception is thrown
An exception filter is called with an exception current in the application, and it can access this exception either with current_exception or via throw.
Implementors of this interface must use throw or std::rethrow_exception in order to filter the passed exception. Generally, the filtration technique should be written as follows:
Alternatively, this strategy may be used:
Filtration methods may safely allow any unhandled rethrows to percolate to the caller. Autowiring will ignore any exceptions thrown by a filter method.
Unhandled exceptions thrown in a context will cause that context to be torn down. By the time the exception filter is called, teardown of the context originating the exception is inevitable. The originating context may potentially be torn down already by the time the filter method is called.
All filter methods are guaranteed to be called in the thread and context of the code which threw the exception. In the case of Fire, it will be in the context of the caller. In the case of Defer, it will be in the context of the callee.
|
inlinevirtual |
This method is invoked when an exception has been thrown by CoreThread::Run
Such an exception is treated as a fatal exception, and will unconditionally result in the enclosing context being torn down. Filters MUST NOT attempt to alter this behavior. If this behavior is not desirable, greater care should be taken to prevent certain exceptions from being unhandled.
Implementors can use "throw" with no arguments to trigger a rethrow of the originating exception.
Exceptions thrown by this method are silently ignored by Autowiring.
|
inlinevirtual |
This is an exception filter for exceptions thrown during a call to Fire
pJunctionBox | The junction box generating the exception |
pRecipient | The target of the call |
Implementors can use "throw" with no arguments to trigger a rethrow of the originating exception.
Exceptions thrown by this method are silently ignored by Autowiring.