Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1367
News FAQ
Search Home


next up previous
Next: When to throw an exception Up: Note 190: Exceptions Changes for AIPS++ Previous: Note 190: Exceptions Changes for AIPS++

Exception mechanism

The C++ exception mechanism provides three features:

1.
Transfer of control between the point in the program where the the exception is thrown, and where it is caught.
2.
Transfoer of information between the ``thrown'' and ``caught'' locations. The information which is transferred can be arbitrary, since any object can be thrown. Note that a copy of the object is thrown.
3.
Destruction of automatic objects.

The differences between the AIPS++ exception emulation and the standard C++ mechanism are as follows:

1.
Only classes that follow certain rules1 may be thrown using the AIPS++ emulation.
2.
Standard exceptions allow ``any'' exception to be caught with a single catch statement (using catch(...)).
3.
Only classes derived from a special base class are destroyed by the AIPS++ exception emulation.
4.
The syntax of the AIPS++ emulation is somewhat different. For example, catch clauses must end with end_try. These differences can be hidden by a macro.
5.
AIPS++ cannot rethrow exceptions.
6.
AIPS++ does not support exception specifications.
7.
AIPS++ exceptions contain the line number and source file of the location from which they were thrown.


next up previous
Next: When to throw an exception Up: Note 190: Exceptions Changes for AIPS++ Previous: Note 190: Exceptions Changes for AIPS++
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-03-28