SourceForge.net Logo timeSeries: timeSeries Class Library

OutOfRange Class Reference
[timeSeries objects]

out of range exception More...

#include <tsExceptions.h>

Inherits tsException.

Collaboration diagram for OutOfRange:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OutOfRange (std::string nm, int indx, int m, int n)
void debug_print ()

Detailed Description

out of range exception

Thrown when the index value used in a timeSeries or timeSeries array object is out of range.


Constructor & Destructor Documentation

OutOfRange::OutOfRange ( std::string  nm,
int  indx,
int  m,
int  n 
) [inline]
Parameters:
nm the name of the object
indx the index used to access the object
m the minimum allowable index
n the maximum allowable index

The information used to construct the OutOfRange exception can be used by the debug_print method to generate readable error messages for the user

Example: the timeSeries [] operator can throw OutOfRange:
         if (k>maxIndex || k<minIndex) {
             throw OutOfRange(varName, k, minIndex, maxIndex);
         }

Member Function Documentation

void OutOfRange::debug_print (  )  [inline, virtual]

error message

Example:
This code:
        try {
            timeSeries<float> swa("CFS_Steering_Wheel_Angle",data); 
            float bad = swa.range(0,50)[51];
        }
        catch (tsException& tse) {
            tse.debug_print();
            cerr << "skipping to next file..." << endl;
        }
Results in this error message:
		Index out of range: index 51
		exceeds range of variable CFS_Steering_Wheel_Angle[0:50]
		skipping to next file...
		

Reimplemented from tsException.

Generated on Tue Mar 16 15:10:52 2010 for timeSeries by  doxygen 1.6.3