SpatialException.h



Classes

SpatialException -- generic HTM exception (full description)
SpatialUnimplemented -- SpatialException thrown by unimplemented functions (full description)
SpatialFailure -- SpatialException thrown on operational failure (full description)
SpatialBoundsError -- SpatialException thrown on violation of array bounds (full description)
SpatialInterfaceError -- SpatialException thrown on violation of interface protocols (full description)

class SpatialException

Interface

Public Members
SpatialException( const char *what = 0, int defIndex = 1 ) throw()
SpatialException( const char *context, const char *because, int defIndex = 1) throw()
SpatialException( const SpatialException& ) throw()
SpatialException& operator=( const SpatialException& ) throw()
virtual ~SpatialException() throw()
virtual const char *what() const throw()
int slen(const char *) const
void clear()

Description

This is the base class for all Science Archive exceptions. It may be used as a generic exception, but programmers are encouraged to use the more specific derived classes. Note that all Spatial exceptions are also Standard Library exceptions by inheritance.

Member Description

SpatialException( const char *what = 0, int defIndex = 1 ) throw()

Default and explicit constructors. The default constructor supplies a generic message indicating the exception type. The explicit constructor sets the message to a copy of the provided string. This behavior is shared by all derived classes.

SpatialException( const char *context, const char *because, int defIndex = 1) throw()

Standard constructor. The message is assembled from copies of the two component strings. The first indicates where in the program the exception was thrown, and the second indicates why. The null pointer is used to select standard components according to the type of the exception. This behavior is shared by all derived classes.

SpatialException( const SpatialException& ) throw()

Copy constructor.

SpatialException& operator=( const SpatialException& ) throw()

Assignment operator.

virtual ~SpatialException() throw()

Destructor.

virtual const char *what() const throw()

Returns the message as set during construction.

int slen(const char *) const

return string length also for null strings

void clear()

deallocate string


class SpatialUnimplemented : public SpatialException

Interface

SpatialUnimplemented( const char *what = 0 ) throw()
SpatialUnimplemented( const char *context, const char *because ) throw()
SpatialUnimplemented( const SpatialUnimplemented& ) throw()

Description

This Exception should be thrown wherever important functionality has been left temporarily unimplemented. Typically this exception will apply to an entire function.

Member Description

SpatialUnimplemented( const char *what = 0 ) throw()

Default and explicit constructors.

SpatialUnimplemented( const char *context, const char *because ) throw()

Standard constructor.

SpatialUnimplemented( const SpatialUnimplemented& ) throw()

Copy constructor.


class SpatialFailure : public SpatialException

Interface

SpatialFailure( const char *what = 0 ) throw()
SpatialFailure( const char *context, const char *because ) throw()
SpatialFailure( const char *context, const char *operation , const char *resource, const char *because = 0 ) throw()
SpatialFailure( const SpatialFailure& ) throw()

Description

This Exception should be thrown when an operation fails unexpectedly. A special constructor is provided for assembling the message from the typical components: program context, operation name, resource name, and explanation. As usual, any component may be left out by specifying the null pointer.

Member Description

SpatialFailure( const char *what = 0 ) throw()

Default and explicit constructors.

SpatialFailure( const char *context, const char *because ) throw()

Standard constructor.

SpatialFailure( const char *context, const char *operation , const char *resource, const char *because = 0 ) throw()

Special constructor.

SpatialFailure( const SpatialFailure& ) throw()

Copy constructor.


class SpatialBoundsError : public SpatialException

Interface

SpatialBoundsError( const char *what = 0 ) throw()
SpatialBoundsError( const char *context , const char *array, int32 limit =-1, int32 index=-1 ) throw()
SpatialBoundsError( const SpatialBoundsError& ) throw()

Description

This Exception should be thrown on detection of an attempt to access elements beyond the boundaries of an array. A special constructor is provided for assembling the message from the typical components: program context, array name, violated boundary, and violating index.

Member Description

SpatialBoundsError( const char *what = 0 ) throw()

Default and explicit constructors.

SpatialBoundsError( const char *context , const char *array, int32 limit =-1, int32 index=-1 ) throw()

Standard constructor. If limit and index are -1, both are considered unknown. Note that the upper limit of a zero-offset array is not the same as the number of elements.

SpatialBoundsError( const SpatialBoundsError& ) throw()

Copy constructor.


class SpatialInterfaceError : public SpatialException

Interface

SpatialInterfaceError( const char *what = 0 ) throw()
SpatialInterfaceError( const char *context, const char *because ) throw()
SpatialInterfaceError( const char *context , const char *argument, const char *because ) throw()
SpatialInterfaceError( const SpatialInterfaceError& ) throw()

Description

This Exception should be thrown when a program, class, or function interface requirement is breached. Specifically, this includes improper usage and invalid arguments. For the latter, a special constructor is provided for assembling the message from the typical components: program context, argument name, and explanation.

Member Description

SpatialInterfaceError( const char *what = 0 ) throw()

Default and explicit constructors.

SpatialInterfaceError( const char *context, const char *because ) throw()

Standard constructor.

SpatialInterfaceError( const char *context , const char *argument, const char *because ) throw()

Special constructor.

SpatialInterfaceError( const SpatialInterfaceError& ) throw()

Copy constructor.

© Copyright The Johns Hopkins University 1999, All Rights Reserved.
Peter Z. Kunszt,