casa::AipsError Class Reference
[Exceptions]

#include <Error.h>

Inheritance diagram for casa::AipsError:

Inheritance graph
[legend]
Collaboration diagram for casa::AipsError:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for all AIPS++ library errors.

Intended use:

Part of API

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Synopsis

This is the base class for all of the AIPS++ error classes. Because all of the errors have a common base class, any error can be caught with a single catch statement.

This class has a string which allows error messages to be propagated.

Tip: The string member must be handled very carefully because string is also derived from cleanup, thus the message.makePermanent() call in the implementation of the constructors. This prevents the String from being cleaned up in the middle of an exception.

Example

         throw(AipsError("SOME STRING"));

To Do

Definition at line 75 of file Error.h.

Public Types

enum  Category

Public Member Functions

virtual const char * what () const throw ()
 Simply returns the stored error message.
const StringgetMesg () const
const AipsError::Category getCategory () const
 ~AipsError () throw ()
 Destructor which does nothing.
 AipsError (const Char *str, Category c=GENERAL)
 Creates an AipsError and initializes the error message from the parameter.
 AipsError (const String &str, Category c=GENERAL)
 AipsError (Category c=GENERAL)

Protected Attributes

String message
Category category


Member Enumeration Documentation

enum casa::AipsError::Category

Definition at line 79 of file Error.h.


Constructor & Destructor Documentation

casa::AipsError::AipsError ( const Char str,
Category  c = GENERAL 
)

Creates an AipsError and initializes the error message from the parameter.

casa::AipsError::AipsError ( const String str,
Category  c = GENERAL 
)

casa::AipsError::AipsError ( Category  c = GENERAL  )  [inline]

Definition at line 100 of file Error.h.

casa::AipsError::~AipsError (  )  throw ()

Destructor which does nothing.


Member Function Documentation

virtual const char* casa::AipsError::what (  )  const throw () [inline, virtual]

Simply returns the stored error message.

Definition at line 87 of file Error.h.

References casa::String::c_str(), and message.

const String& casa::AipsError::getMesg (  )  const [inline]

Definition at line 89 of file Error.h.

References message.

const AipsError::Category casa::AipsError::getCategory (  )  const [inline]

Definition at line 91 of file Error.h.

References category.


Member Data Documentation

String casa::AipsError::message [protected]

Definition at line 109 of file Error.h.

Referenced by getMesg(), casa::MSSelectionError::reset(), and what().

Category casa::AipsError::category [protected]

Definition at line 110 of file Error.h.

Referenced by getCategory().


The documentation for this class was generated from the following file:
Generated on Thu Jul 3 22:35:28 2008 for NRAOCASA by  doxygen 1.5.1