The concrete class TFPExceptionHandler provides for the automatic throwing of floating-point exceptions from within a try block. You pass its constructor a TFPExceptionSet object. The constructor:
- Saves its argument--the requested exceptions--for reference by the destructor
- Saves the current settings of the environment's exception flags--the old history
- Clears all of the environment's exception flags, creating a new history
As the block executes, exception flags will be raised and cleared as with any computation. At the end of the block, the destructor:
- Saves the now-current settings of the flags--the recent history
- Forms the complete history from the union of the old and recent histories, placing these flag settings in the environment
- Forms the offending exceptions, the intersection of the recent history and the requested exceptions; if there are any offending exceptions, the handler:
- Converts the one of highest priority to the corresponding TFPException derived class, passing the set of offending exceptions to the constructor
- Throws the exception object
The member functions GetRequestedExceptions and GetSavedExceptions give access to the requested exceptions and old history, respectively.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.
Generated with WebMaker