length error exception More...
#include <tsExceptions.h>
Inherits tsException.
Public Member Functions | |
Length_error (std::string p, std::string n1, std::string n2, const int len1, const int len2) | |
void | debug_print () |
length error exception
Thrown when the sample length of two timeSeries objects in a comparison or arithmetic operation are not the same.
Length_error::Length_error | ( | std::string | p, | |
std::string | n1, | |||
std::string | n2, | |||
const int | len1, | |||
const int | len2 | |||
) | [inline] |
p | a string describing the offending operation | |
n1 | the name of a timeSeries | |
n2 | the name of a timeSeries | |
len1 | the length of timeSeries n1 | |
len2 | the length of timeSeries n2 |
The information used to construct the Length_error exception can be used by the debug_print method to generate readable error messages for the user
>
operator can throw a Length_error:if (d.length() != ts.length()) { throw Length_error(">",d.varName,ts.varName,d.length(),ts.length()); }
void Length_error::debug_print | ( | ) | [inline, virtual] |
error message
try { timeSeries<float> throttle("CFS_Accelerator_Pedal_Position",data); timeSeries<float> swa("CFS_Steering_Wheel_Angle",data); boolResult bad = (throttle > swa.range(0,50)); } catch (tsException& tse) { tse.debug_print(); cerr << "skipping to next file..." << endl; }
Illegal operation: (>) CFS_Accelerator_Pedal_Position has length 6952 CFS_Steering_Wheel_Angle has length 51 skipping to next file...
Reimplemented from tsException.