out of range exception More...
#include <tsExceptions.h>
Inherits tsException.
Public Member Functions | |
OutOfRange (std::string nm, int indx, int m, int n) | |
void | debug_print () |
out of range exception
Thrown when the index value used in a timeSeries or timeSeries array object is out of range.
OutOfRange::OutOfRange | ( | std::string | nm, | |
int | indx, | |||
int | m, | |||
int | n | |||
) | [inline] |
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
if (k>maxIndex || k<minIndex) { throw OutOfRange(varName, k, minIndex, maxIndex); }
void OutOfRange::debug_print | ( | ) | [inline, virtual] |
error message
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; }
Index out of range: index 51 exceeds range of variable CFS_Steering_Wheel_Angle[0:50] skipping to next file...
Reimplemented from tsException.