Commit 9b4f0b37 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

Merge branch 'tscollect' into croposp

parents bc3fbf59 05385dc9
/*! \file tscollection.h
* \brief provide a container for a collection of time series with header data (prototypes)
*
* ----------------------------------------------------------------------------
*
* \author Thomas Forbriger
* \date 29/12/2018
*
* provide a container for a collection of time series with header data
* (prototypes)
*
* Copyright (c) 2018 by Thomas Forbriger (BFO Schiltach)
*
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ----
*
* REVISIONS and CHANGES
* - 29/12/2018 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TS_TSCOLLECTION_H_VERSION
#define TS_TSCOLLECTION_H_VERSION \
"TS_TSCOLLECTION_H V1.0"
#include<list>
#include<tsxx/wid2timeseries.h>
namespace ts {
/*! \brief A class template for a list of time series with SFF header.
*
* \param T value type of series container
*/
template<typename T>
class TimeSeriesCollection:
public std::list<TimeSeries<aff::Series<T>, ::sff::WID2> >
{
public:
/*! \name Type definitions.
*/
//!@{
typedef T Tvalue;
typedef aff::Series<Tvalue> Tseries;
typedef ::sff::WID2 Theader;
typedef ts::TimeSeries<Tseries, Theader> Ttimeseries;
typedef ts::TimeSeries<typename Tseries::Tcoc, Theader> Tconsttimeseries;
typedef std::list<Ttimeseries> Tbase;
//!@}
/*! \name Constructors.
*
* Conversion constructors are declared explicit, to avoid confusion,
* in mutual assignments of different class derived from this
* template. They all are a valid Tseries by definition.
*/
//!@{
//!@}
}; // class TimeSeriesCollection
} // namespace ts
#endif // TS_TSCOLLECTION_H_VERSION (includeguard)
/* ----- END OF tscollection.h ----- */
......@@ -89,13 +89,13 @@ namespace ts {
* application of the const qualifier. This is not the case for
* samples, being addressed through the series with handle semantics.
*/
//@{
//!@{
typedef S Tseries;
typedef H Theader;
typedef typename Tseries::Tvalue Tvalue;
typedef TimeSeries<Tseries, Theader> Ttimeseries;
typedef TimeSeries<typename Tseries::Tcoc, Theader> Tconsttimeseries;
//@}
//!@}
/*! \name Constructors.
*
......@@ -103,32 +103,32 @@ namespace ts {
* in mutual assignments of different class derived from this
* template. They all are a valid Tseries by definition.
*/
//@{
//!@{
TimeSeries() { }
TimeSeries(const Tseries& s, const Theader& h):
Tseries(s), header(h) { }
TimeSeries(const Ttimeseries& s):
Tseries(s), header(s.header) { }
//@}
//!@}
/*! \name Assignment operators.
*/
//@{
//!@{
//! assign series to time series
Ttimeseries& operator=(const Tseries& s)
{ this->Tseries::operator=(s); return(*this); }
//! set values of series in time series
Ttimeseries& operator=(const Tvalue& v)
{ this->Tseries::operator=(v); return(*this); }
//@}
//!@}
/*! \name Type conversion.
*/
//@{
//!@{
//Tseries& series() { return(*this); }
operator Tconsttimeseries() const
{ return(Tconsttimeseries(*this, header)); }
//@}
//!@}
public:
//! data header fields
Theader header;
......
......@@ -46,11 +46,11 @@ namespace ts {
// SFF version
//! double precision data with SFF header
typedef TimeSeries<aff::Series<double>, sff::WID2> TDsfftimeseries;
typedef TimeSeries<aff::Series<double>, ::sff::WID2> TDsfftimeseries;
//! single precision data with SFF header
typedef TimeSeries<aff::Series<float>, sff::WID2> TSsfftimeseries;
typedef TimeSeries<aff::Series<float>, ::sff::WID2> TSsfftimeseries;
//! integer data with SFF header
typedef TimeSeries<aff::Series<int>, sff::WID2> TIsfftimeseries;
typedef TimeSeries<aff::Series<int>, ::sff::WID2> TIsfftimeseries;
} // namespace ts
......
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