Commit ea18ed2b authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libtsxx [FEATURE]: provide additional input/output operators

provide input and output operators for ianystream and oanystream;
they are not inherited from idatstream and odatstream, type conversion
is not possible, when call the operators for TimeSeries objects
parent 86a3b35b
......@@ -27,6 +27,8 @@
*
* REVISIONS and CHANGES
* - 22/11/2016 V1.0 Thomas Forbriger
* - 13/04/2018 V1.1 provide input and output operator for
* ianystream and oanystream too
*
* ============================================================================
*/
......@@ -35,15 +37,34 @@
#ifndef TSXX_WID2TSIO_H_VERSION
#define TSXX_WID2TSIO_H_VERSION \
"TSXX_WID2TSIO_H V1.0"
"TSXX_WID2TSIO_H V1.1"
#include<tsxx/wid2timeseries.h>
#include<datrwxx/datread.h>
#include<datrwxx/datwrite.h>
#include<datrwxx/readany.h>
#include<datrwxx/writeany.h>
#include<tsxx/debug.h>
namespace ts {
/*! output operator template for time series with WID2 header
*/
template<class C>
datrw::oanystream& operator<<(datrw::oanystream& os,
TimeSeries<C, sff::WID2>& s)
{
TSXX_debug(os.debug(),
"datrw::oanystream& operator>>(datrw::oanystream& os,\n"
" TimeSeries<C, sff::WID2>& s)",
TSXX_value(s.header.line()));
os << s.header;
typename TimeSeries<C, sff::WID2>::Tseries series(s);
os << series;
return(os);
} // datrw::oanystream& operator<<(datrw::oanystream& os,
// TimeSeries<C, sff::WID2>& s)
/* ---------------------------------------------------------------------- */
/*! output operator template for time series with WID2 header
*/
template<class C>
......@@ -62,7 +83,27 @@ namespace ts {
// TimeSeries<C, sff::WID2>& s)
/* ---------------------------------------------------------------------- */
/*! input operator template for time series with WID2 header
*/
template<class C>
datrw::ianystream& operator>>(datrw::ianystream& is,
TimeSeries<C, sff::WID2>& s)
{
typename TimeSeries<C, sff::WID2>::Tseries series;
is >> series;
s=series;
is >> s.header;
TSXX_debug(is.debug(),
"datrw::ianystream& operator>>(datrw::ianystream& is,\n"
" TimeSeries<C, sff::WID2>& s)",
TSXX_value(s.header.line()));
return(is);
} // datrw::ianystream& operator>>(datrw::ianystream& is,
// TimeSeries<C, sff::WID2>& s)
/* ---------------------------------------------------------------------- */
/*! input operator template for time series with WID2 header
*/
template<class C>
......
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