Commit 2df1f1bf authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libtsxx [WP]: provide new excpetion class

We need a new exception to indicate an empty time window for cases, where the
interpolator shrinks the time window to fit into the time span of the input
time series.
parent a61d27fb
......@@ -4,11 +4,11 @@
* ----------------------------------------------------------------------------
*
* \author Thomas Forbriger
* \date 13/07/2005
* \date 07/11/2017
*
* interpolation interface (implementation)
*
* Copyright (c) 2005 by Thomas Forbriger (BFO Schiltach)
* Copyright (c) 2005, 2017 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -29,11 +29,13 @@
* REVISIONS and CHANGES
* - 13/07/2005 V1.0 Thomas Forbriger
* - 28/07/2005 V1.1 indicate wrong time window by specific exception
* - 07/11/2017 V1.2
* -provide new exception to indicate empty time window
*
* ============================================================================
*/
#define TF_IPO_CC_VERSION \
"TF_IPO_CC V1.1"
"TF_IPO_CC V1.2"
#include <tsxx/ipo.h>
......@@ -49,6 +51,14 @@ namespace ts {
: Exception(message, file, line, cond)
{ }
// exception constructor
ExceptionTimeWindowEmpty::ExceptionTimeWindowEmpty(const char* message,
const char* file,
const int& line,
const char* cond)
: Exception(message, file, line, cond)
{ }
//! resample a time series
ts::TDsfftimeseries resample(const Interpolator& ip,
const libtime::TAbsoluteTime& first,
......
......@@ -4,11 +4,11 @@
* ----------------------------------------------------------------------------
*
* \author Thomas Forbriger
* \date 13/07/2005
* \date 07/11/2017
*
* interpolation interface (prototypes)
*
* Copyright (c) 2005 by Thomas Forbriger (BFO Schiltach)
* Copyright (c) 2005, 2017 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -29,6 +29,8 @@
* REVISIONS and CHANGES
* - 13/07/2005 V1.0 Thomas Forbriger
* - 28/07/2005 V1.1 indicate wrong time window by specific exception
* - 07/11/2017 V1.2
* -provide new exception to indicate empty time window
*
* ============================================================================
*/
......@@ -37,7 +39,7 @@
#ifndef TF_IPO_H_VERSION
#define TF_IPO_H_VERSION \
"TF_IPO_H V1.1"
"TF_IPO_H V1.2"
#include<tsxx/tsxx.h>
#include<tsxx/error.h>
......@@ -72,6 +74,24 @@ namespace ts {
const char* condition);
}; // class ExceptionTimeWindowOutside
/*! \brief Exception in case resulting time window is empty
*
* This execption indicates that after the time window was shrinked, no
* sample from the input time series is available within the defined time
* window.
*
* \ingroup ipo
*/
class ExceptionTimeWindowEmpty:
public ts::error::Exception
{
public:
ExceptionTimeWindowEmpty(const char* message,
const char* file,
const int& line,
const char* condition);
}; // class ExceptionTimeWindowEmpty
/*! \brief Interface to time series interpolator
*
* \ingroup ipo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment