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


next up previous contents index
Next: Interface Up: Exceptions Previous: Exceptions

Introduction

The main intent of this paper is to provide a user level introduction to the C++ exception mechanism with a basic introduction to the way it is used in aips++. This should allow developers to use the mechanism.

C++ provides a standard method to handle exceptional conditions. When such conditions arise, control is transferred to a code block which can handle the exception, if one exists. If no handler exists which is capable of handling the exception, the program is aborted. This package handles cleaning up the call stack which may have been created between when the handler was installed and when the exception was thrown. In addition, any objects which were created on the stack during this period will be deleted.

This provides a mechanism for transferring control from the point where an exceptional condition occurs to the code to handle the exception without memory leaks. Some of the advantages of this approach are:

So while everything which can be accomplished with exceptions can be accomplished with returned error codes or other traditional approaches, the use of exceptions is cleaner.


next up previous contents index
Next: Interface Up: Exceptions Previous: Exceptions   Contents   Index
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-10-15