ArrayError.h

Classes

ArrayError -- The base class for all Array exception classes. (full description)
ArrayIndexError -- An error thrown when an index is out of range (full description)
ArrayConformanceError -- An error thrown when two arrays do not conform (full description)
ArrayNDimError -- Thrown when two arrays have different dimensionality (full description)
ArrayShapeError -- An error thrown when two arrays have different shapes (full description)
ArrayIteratorError -- An error thrown by an ArrayIterator (full description)
ArraySlicerError -- An error thrown by an Slicer member function (full description)

class ArrayError : public AipsError

Interface

Public Members
ArrayError(Category c=GENERAL)
ArrayError(const Char *m,Category c=GENERAL)
ArrayError(const String &m,Category c=GENERAL)
~ArrayError() throw()

Description

Review Status

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

ArrayError is the base class for all the Array-specific exception classes, i.e. if it is caught you will catch (through inheritance) all Array-specific exceptions. Note that (presently, anyway) the Array classes will throw a few non-Array exceptions, in particular AllocError.

    try {
       // Some lines, functions, ...
    } catch (ArrayError x) {
       // Array specific errors
    } catch (AipsError x) {
       // All other errors caught here.
    }
    

Tip There are too many ArrayRelated classes. Some should be deleted.

Member Description

ArrayError(Category c=GENERAL)

Initialize with the message "ArrayError."

ArrayError(const Char *m,Category c=GENERAL)

Initialize with the supplied message.

ArrayError(const String &m,Category c=GENERAL)

Initialize with the supplied message.

~ArrayError() throw()


class ArrayIndexError : public ArrayError

Interface

ArrayIndexError(Category c=BOUNDARY)
ArrayIndexError(const Char *m,Category c=BOUNDARY)
ArrayIndexError(const String &m,Category c=BOUNDARY)
ArrayIndexError(const IPosition &index, const IPosition &shape, const Char *m="ArrayIndexError",Category c=BOUNDARY)
~ArrayIndexError() throw()
IPosition index() const
IPosition shape() const

Description

Review Status

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

The ArrayIndexError class, which is derived from ArrayError, is intended to be thrown when an index is out-of-bounds. It contains within it the offending index, as well as the shape of the array which is being indexed. This should be multiply-derived from indexError defined in Error.h.

Member Description

ArrayIndexError(Category c=BOUNDARY)

Initialize with the message "ArrayIndexError".

ArrayIndexError(const Char *m,Category c=BOUNDARY)

Initialize with the supplied message, the index and shape are null.

ArrayIndexError(const String &m,Category c=BOUNDARY)

Initialize with the supplied message, the index and shape are null.

ArrayIndexError(const IPosition &index, const IPosition &shape, const Char *m="ArrayIndexError",Category c=BOUNDARY)

Initialize with a given out-of-bounds index, as well as the shape of the array and a supplied message.

~ArrayIndexError() throw()

IPosition index() const

The out-of-bounds index.

IPosition shape() const

The shape of the violated array.

class ArrayConformanceError : public ArrayError

Interface

ArrayConformanceError(Category c=CONFORMANCE)
ArrayConformanceError(const Char *m,Category c=CONFORMANCE)
ArrayConformanceError(const String &m,Category c=CONFORMANCE)
~ArrayConformanceError() throw()

Description

Review Status

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

The ArrayConformanceError class is the base class for all errors thrown because two arrays are not conformant. See also the ArrayShapeError and ArrayNDimError classes which are derived from it. This error, or one derived from it, os normally thrown from a binary operation (arithmetic, logical, assignment, etc).

Member Description

ArrayConformanceError(Category c=CONFORMANCE)

Initialize the message with "ArrayConformanceError".

ArrayConformanceError(const Char *m,Category c=CONFORMANCE)

Initialize with a supplied message.

ArrayConformanceError(const String &m,Category c=CONFORMANCE)

Initialize with a supplied message.

~ArrayConformanceError() throw()


class ArrayNDimError : public ArrayConformanceError

Interface

ArrayNDimError(Int dim1, Int dim2, const Char *m="ArrayNDimError",Category c=CONFORMANCE)
~ArrayNDimError() throw()
void ndims(Int &dim1, Int &dim2) const

Description

Review Status

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

An ArrayNDimError is derived from ArrayConformanceError. It is thrown when two arrays are non-conformant by virtue of having different dimensionality. It holds within it the two dimensions.

Member Description

ArrayNDimError(Int dim1, Int dim2, const Char *m="ArrayNDimError",Category c=CONFORMANCE)

Define the two (presumably different) messages and optionally supply a message.

~ArrayNDimError() throw()

void ndims(Int &dim1, Int &dim2) const

Return the stored dimensions. NB modifies arguments.

class ArrayShapeError : public ArrayConformanceError

Interface

ArrayShapeError(const IPosition &shape1, const IPosition &shape2, const Char *m="ArrayShapeError",Category c=CONFORMANCE)
~ArrayShapeError() throw()
void shapes(IPosition &, IPosition &) const

Description

Review Status

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

An ArrayShapeError is derived from ArrayConformanceError. It is thrown when two arrays are non-conformant by virtue of having different shapes. It holds within it the two different two shapes.

Member Description

ArrayShapeError(const IPosition &shape1, const IPosition &shape2, const Char *m="ArrayShapeError",Category c=CONFORMANCE)

Define an ArrayShapeError with the two (presumably different) shapes and an optional supplied message.

~ArrayShapeError() throw()

void shapes(IPosition &, IPosition &) const

Get back the stored shapes. NB modifies arguments.

class ArrayIteratorError : public ArrayError

Interface

ArrayIteratorError(Category c=BOUNDARY)
ArrayIteratorError(const Char *m,Category c=BOUNDARY)
ArrayIteratorError(const String &m,Category c=BOUNDARY)
~ArrayIteratorError() throw()

Description

Review Status

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

An ArrayIteratorError is thrown by an array iterator or related class (e.g. VectorIterator).

Member Description

ArrayIteratorError(Category c=BOUNDARY)

Initialize with the message "ArrayIteratorError.

ArrayIteratorError(const Char *m,Category c=BOUNDARY)

Initialize with the supplied message

ArrayIteratorError(const String &m,Category c=BOUNDARY)

Initialize with the supplied message

~ArrayIteratorError() throw()


class ArraySlicerError : public ArrayError

Interface

ArraySlicerError(Category c=GENERAL)
ArraySlicerError(const String &m,Category c=GENERAL)
~ArraySlicerError() throw()

Description

Review Status

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

An ArraySlicerError is thrown by an Slicer member function.

Member Description

ArraySlicerError(Category c=GENERAL)

Initialize with the message "Slicer error."

ArraySlicerError(const String &m,Category c=GENERAL)

Initialize with ArraySlicerError plus the supplied message

~ArraySlicerError() throw()