University of Sheffield   

    The Simons
    Component Library

Introduction   Class Hierarchy   Class Listing   Index of Classes   Index of Methods   Header Files  

OutOfRange Class Reference

#include <OutOfRange.h>

Inheritance diagram for OutOfRange:

MethodError Exception Object List of all members.

Detailed Description

OutOfRange: signals an out-of-range access using an invalid index.

Raise an OutOfRange exception if an attempt is made to access an element of a Collection at an out-of-range index. Similar indexed containers may also raise this exception. OutOfRange provides access to the failed object(), the error message(), the failed method() and the failed index(). Typically, an OutOfRange exception is due to a semantic error in program code, using an index that is off-by-one, and so should be treated as fatal. However, client programs may choose to handle this exception in appropriate ways.


Public Member Functions

 OutOfRange ()
 Construct a default OutOfRange.

virtual ~OutOfRange ()
 Release an OutOfRange.

 OutOfRange (ObjectID, StringID, Integer)
 Construct an OutOfRange exception.

virtual ObjectID clone () const
 Clone a shallow copy of this OutOfRange.

Integer index () const
 Access the out-of-range index.


Protected Member Functions

 OutOfRange (const OutOfRange &)
 Copy another OutOfRange.


Protected Attributes

Integer failedIndex
 The failed index.


Constructor & Destructor Documentation

OutOfRange::OutOfRange const OutOfRange &  exception  )  [protected]
 

Copy another OutOfRange.

Required by C++ to ensure that copying an OutOfRange faithfully copies a MethodError.

Parameters:
exception - the OutOfRange to copy.
Returns:
an OutOfRange, a shallow copy.

OutOfRange::OutOfRange  ) 
 

Construct a default OutOfRange.

Returns:
an OutOfRange

OutOfRange::~OutOfRange  )  [virtual]
 

Release an OutOfRange.

OutOfRange::OutOfRange ObjectID  object,
StringID  method,
Integer  index
 

Construct an OutOfRange exception.

Raised when an attempt is made to access an element of a Collection at an out-of-range index. May also be raised by other kinds of container which index their elements.

Parameters:
object - the object on which element access failed.
method - the name of the failed method.
index - the index which was out-of-range.
Returns:
an OutOfRange exception.


Member Function Documentation

ObjectID OutOfRange::clone  )  const [virtual]
 

Clone a shallow copy of this OutOfRange.

Returns:
an OutOfRange exception, a shallow copy.

Reimplemented from Exception.

Integer OutOfRange::index  )  const [inline]
 

Access the out-of-range index.

Returns:
the out-of-range index.


Member Data Documentation

Integer OutOfRange::failedIndex [protected]
 

The failed index.


The documentation for this class was generated from the following files:
Generated on Fri May 5 17:17:18 2006 for The Simons Component Library by doxygen1.3