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. }
There are too many ArrayRelated classes. Some should be deleted.
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
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).
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.
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.
An ArrayIteratorError is thrown by an array iterator or related class
(e.g. VectorIterator).
An ArraySlicerError is thrown by an Slicer member function.
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
Description
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
Description
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
Description
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
Description
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
Description
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()