SourceForge.net Logo timeSeries: timeSeries Class Library

BadDimension Class Reference
[timeSeries objects]

Dimension mismatch during construction. More...

#include <tsExceptions.h>

Inherits tsException.

Collaboration diagram for BadDimension:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BadDimension (std::string oc, std::string fn, int d)
void debug_print ()

Detailed Description

Dimension mismatch during construction.

Thrown when an attempt is made to construct a timeSeries object from a timeSeriesArray field. This exception is also thrown when attempting to construct a timeSeriesArray object from a timeSeries field.


Constructor & Destructor Documentation

BadDimension::BadDimension ( std::string  oc,
std::string  fn,
int  d 
) [inline]
Parameters:
oc a string containing either "timeSeries" or "timeSeriesArray"
fn a string containin the name of the field
d an integer containing the dimension of the field

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


Member Function Documentation

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

error message

Example:

If the data definition for field CFS_Auto_Transmission_Mode specifies a dimension of 1 then the following code will generate a BadDimension exception:

    try {
        timeSeriesArray<short> prndl("CFS_Auto_Transmission_Mode",data);
    }
    catch (tsException& tse) {
        tse.debug_print();
        cerr << "skipping to next file..." << endl;
    }

Results in this error message:

	Illegal Construction: attempt to construct a timeSeriesArray
	from data field "CFS_Auto_Transmission_Mode" of dimension 1
	skipping to next file...
	

Similarly, if the data definition for field SCC_Lane_Deviation specifies a dimension of 4, then this code is also in error:

    try {
        timeSeries<float> lanedev("SCC_Lane_Deviation",data);
    }
    catch (tsException& tse) {
        tse.debug_print();
        cerr << "skipping to next file..." << endl;
    }

Results in this error message:

	Illegal Construction: attempt to construct a timeSeries
	from data field "SCC_Lane_Deviation" of dimension 4
	skipping to next file...
	

Reimplemented from tsException.

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