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

[WP][TASK][FIX] (ticket10tsio): provide required header files

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

After reorganizing the source code, the required header files must be included
in the appropriate places.

Accomplished:
 - source code compiles without errors

Missing:
 - doxygen documentation must be reorganized
 - README file must be completed
 - snapshot package rules must adjusted
 - library must be tested with application programs
parent 8047844b
...@@ -48,10 +48,10 @@ INCINSTALLPATH=$(LOCINCLUDEDIR)/tsioxx ...@@ -48,10 +48,10 @@ INCINSTALLPATH=$(LOCINCLUDEDIR)/tsioxx
INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(notdir $(HEADERS))) INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(notdir $(HEADERS)))
FLAGS+=-fPIC $(MYFLAGS) FLAGS+=-fPIC $(MYFLAGS)
CXXFLAGS+=-fhonor-std -Wall $(FLAGS) CXXFLAGS+= -Wall $(FLAGS)
CXXFLAGS+=$(FLAGS) CXXFLAGS+=$(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR) $(TF_LINK_REGEXX) LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS) $(REGEXXFLAG) CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
CODEFILES=$(HEADERS) $(SRC) CODEFILES=$(HEADERS) $(SRC)
OTHERFILES=Makefile doxydoc.cfg COPYING README $(DOXYTXT) OTHERFILES=Makefile doxydoc.cfg COPYING README $(DOXYTXT)
...@@ -83,7 +83,7 @@ clean: ; ...@@ -83,7 +83,7 @@ clean: ;
> $@; \ > $@; \
[ -s $@ ] || rm -f $@' [ -s $@ ] || rm -f $@'
include $(patsubst %.cc,%.d,$(SRC) $(TESTS)) include $(patsubst %.cc,%.d,$(SRC))
#====================================================================== #======================================================================
# library part # library part
......
...@@ -43,13 +43,11 @@ ...@@ -43,13 +43,11 @@
#define TSIO_SFFOUTPUTOPERATORS_H_CVSID \ #define TSIO_SFFOUTPUTOPERATORS_H_CVSID \
"$Id: $" "$Id: $"
#include<sffxx.h> #warning Use of this module is deprecated.
#include<tsxx/tsxx.h> #warning Better use outputoperators.h for libdatrwxx streams.
#include<datrwxx/datread.h>
#include<datrwxx/datwrite.h> #include<tsioxx/sfftsfile.h>
#include<tfxx/rangelist.h>
#include<sffostream.h> #include<sffostream.h>
#include<vector>
/*! \brief Interface to libsffxx /*! \brief Interface to libsffxx
* *
......
...@@ -40,7 +40,10 @@ ...@@ -40,7 +40,10 @@
#define TSIO_CMDLINEFILES_CC_CVSID \ #define TSIO_CMDLINEFILES_CC_CVSID \
"$Id: $" "$Id: $"
#include <cmdlinefiles.h> #include <fstream>
#include <tsioxx/cmdlinefiles.h>
#include <tsioxx/inputoperators.h>
#include <tfxx/rangestring.h>
namespace ts { namespace ts {
......
...@@ -45,13 +45,9 @@ ...@@ -45,13 +45,9 @@
#define TSIO_CMDLINEFILES_H_CVSID \ #define TSIO_CMDLINEFILES_H_CVSID \
"$Id: $" "$Id: $"
#include<tfxx/rangelist.h> #include<tsioxx/sfftsfile.h>
#include<tfxx/xcmdline.h> #include<tfxx/xcmdline.h>
#include<tfxx/rangestring.h>
#include<datrwxx/readany.h> #include<datrwxx/readany.h>
#include<tsioxx/sffheaders.h>
#include<iostream>
#include<fstream>
/*! \defgroup group_readtsdata Reading of time series data. /*! \defgroup group_readtsdata Reading of time series data.
* \brief Read a complete set of time series including the selection of * \brief Read a complete set of time series including the selection of
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#define TSIO_INPUTOPERATORS_CC_CVSID \ #define TSIO_INPUTOPERATORS_CC_CVSID \
"$Id: $" "$Id: $"
#include <inputoperators.h> #include <tsioxx/inputoperators.h>
namespace ts { namespace ts {
......
...@@ -45,13 +45,8 @@ ...@@ -45,13 +45,8 @@
#define TSIO_INPUTOPERATORS_H_CVSID \ #define TSIO_INPUTOPERATORS_H_CVSID \
"$Id: $" "$Id: $"
#include<sffxx.h> #include<tsioxx/sfftsfile.h>
#include<tsxx/tsxx.h>
#include<datrwxx/datread.h> #include<datrwxx/datread.h>
#include<datrwxx/datwrite.h>
#include<tfxx/rangelist.h>
#include<sffostream.h>
#include<vector>
/*! \brief Interface to libdatrwxx /*! \brief Interface to libdatrwxx
* *
...@@ -67,7 +62,6 @@ namespace ts { ...@@ -67,7 +62,6 @@ namespace ts {
namespace sff { namespace sff {
/*======================================================================*/
// libdatrwxx input operators // libdatrwxx input operators
datrw::idatstream& operator>>(datrw::idatstream& is, FileHeader& fh); datrw::idatstream& operator>>(datrw::idatstream& is, FileHeader& fh);
...@@ -80,76 +74,8 @@ namespace ts { ...@@ -80,76 +74,8 @@ namespace ts {
SFFTimeSeries<C>& s) SFFTimeSeries<C>& s)
{ return(is >> s.series() >> s.header); } { return(is >> s.series() >> s.header); }
/*======================================================================*/
// libdatrwxx output operators
inline
datrw::odatstream& operator<<(datrw::odatstream& os,
const FileHeader& fh)
{
if (fh.hasfree()) { os << fh.free(); }
if (fh.hassrce()) { os << fh.srce(); }
return os;
}
/*----------------------------------------------------------------------*/
inline
datrw::odatstream& operator<<(datrw::odatstream& os,
const TraceHeader& th)
{
os << th.wid2();
if (th.hasfree()) { os << th.free(); }
if (th.hasinfo()) { os << th.info(); }
return os;
}
/*----------------------------------------------------------------------*/
/*! \note
* The compiler cannot distinguish between this definition and the
* next one.
*/
template<class C>
datrw::odatstream& operator<<(datrw::odatstream& os,
const typename SFFTimeSeries<C>::Tconsttimeseries& s)
{
typedef typename SFFTimeSeries<C>::Tconsttimeseries::Tseries Tseries;
return(os << s.header << Tseries(s));
}
/*----------------------------------------------------------------------*/
template<class C>
datrw::odatstream& operator<<(datrw::odatstream& os,
const SFFTimeSeries<C>& s)
{
typedef typename SFFTimeSeries<C>::Tcoc Tcoc;
return(os << s.header << Tcoc(s));
}
/*----------------------------------------------------------------------*/
template<class C>
datrw::odatstream& operator<<(datrw::odatstream& os,
const TraceVector<C>& tv)
{
typedef TraceVector<C> Ttracevector;
for(typename Ttracevector::const_iterator i=tv.begin();
i != tv.end(); ++i)
{ os << *i; }
return os;
}
/*----------------------------------------------------------------------*/
template<class C>
datrw::odatstream& operator<<(datrw::odatstream& os,
const File<C>& f)
{ return(os << f.fileheader << TraceVector<C>(f)); }
/*! /*!
* @} * @{
*/ */
} // namespace sff } // namespace sff
......
/*! \file outputoperators.cc
* \brief output operators for SFF TimeSeries traces and files to libdatrwxx
* streams (implementation).
*
* ----------------------------------------------------------------------------
*
* $Id: $
* \author Thomas Forbriger
* \since 18/07/2005
* \date 30/01/2014
*
* output operators for SFF TimeSeries traces and files to libdatrwxx streams
* (implementation)
*
* Copyright (c) 2005-2007, 2012, 2014 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, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
* REVISIONS and CHANGES
* - 30/01/2014 V1.0 Thomas Forbriger (thof):
* copied from sffheaders.cc
*
* ============================================================================
*/
#define TSIO_OUTPUTOPERATORS_CC_VERSION \
"TF_OUTPUTOPERATORS_CC 2014/01/30"
#define TSIO_OUTPUTOPERATORS_CC_CVSID \
"$Id: $"
#include <outputoperators.h>
namespace ts {
namespace sff {
datrw::idatstream& operator>>(datrw::idatstream& is,
FileHeader& fh)
{
::sff::FREE free;
::sff::SRCE srce;
fh=FileHeader();
if (is.hasfree()) { is >> free; fh.free(free); }
if (is.hassrce()) { is >> srce; fh.srce(srce); }
return(is);
}
datrw::idatstream& operator>>(datrw::idatstream& is,
TraceHeader& th)
{
::sff::FREE free;
::sff::INFO info;
::sff::WID2 wid2;
th=TraceHeader();
is >> wid2; th.wid2(wid2);
if (is.hasfree()) { is >> free; th.free(free); }
if (is.hasinfo()) { is >> info; th.info(info); }
return(is);
}
} // namespace sff
} // namespace ts
/* ----- END OF outputoperators.cc ----- */
...@@ -45,13 +45,8 @@ ...@@ -45,13 +45,8 @@
#define TSIO_OUTPUTOPERATORS_H_CVSID \ #define TSIO_OUTPUTOPERATORS_H_CVSID \
"$Id: $" "$Id: $"
#include<sffxx.h> #include<tsioxx/sfftsfile.h>
#include<tsxx/tsxx.h>
#include<datrwxx/datread.h>
#include<datrwxx/datwrite.h> #include<datrwxx/datwrite.h>
#include<tfxx/rangelist.h>
#include<sffostream.h>
#include<vector>
/*! \brief Interface to libdatrwxx /*! \brief Interface to libdatrwxx
* *
...@@ -67,19 +62,6 @@ namespace ts { ...@@ -67,19 +62,6 @@ namespace ts {
namespace sff { namespace sff {
/*======================================================================*/
// libdatrwxx input operators
datrw::idatstream& operator>>(datrw::idatstream& is, FileHeader& fh);
datrw::idatstream& operator>>(datrw::idatstream& is, TraceHeader& th);
/*----------------------------------------------------------------------*/
template<class C>
datrw::idatstream& operator>>(datrw::idatstream& is,
SFFTimeSeries<C>& s)
{ return(is >> s.series() >> s.header); }
/*======================================================================*/ /*======================================================================*/
// libdatrwxx output operators // libdatrwxx output operators
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define TSIO_SFFTIMESERIES_CC_CVSID \ #define TSIO_SFFTIMESERIES_CC_CVSID \
"$Id: $" "$Id: $"
#include <sfftimeseries.h> #include <tsioxx/sfftimeseries.h>
namespace ts { namespace ts {
......
...@@ -45,11 +45,6 @@ ...@@ -45,11 +45,6 @@
#include<sffxx.h> #include<sffxx.h>
#include<tsxx/tsxx.h> #include<tsxx/tsxx.h>
#include<datrwxx/datread.h>
#include<datrwxx/datwrite.h>
#include<tfxx/rangelist.h>
#include<sffostream.h>
#include<vector>
/*! \brief SFF Timeseries I/O. /*! \brief SFF Timeseries I/O.
* *
......
...@@ -39,9 +39,7 @@ ...@@ -39,9 +39,7 @@
#define TSIO_SFFTSFILE_CC_CVSID \ #define TSIO_SFFTSFILE_CC_CVSID \
"$Id: $" "$Id: $"
#include <sfftsfile.h> #include <tsioxx/sfftsfile.h>
#include <tsioxx/sffheaders.h>
namespace ts { namespace ts {
......
...@@ -43,12 +43,9 @@ ...@@ -43,12 +43,9 @@
#define TSIO_SFFTSFILE_H_CVSID \ #define TSIO_SFFTSFILE_H_CVSID \
"$Id: $" "$Id: $"
#include<sffxx.h> #include<tsioxx/sfftimeseries.h>
#include<tsxx/tsxx.h>
#include<datrwxx/datread.h> #include<datrwxx/datread.h>
#include<datrwxx/datwrite.h>
#include<tfxx/rangelist.h> #include<tfxx/rangelist.h>
#include<sffostream.h>
#include<vector> #include<vector>
/*! \brief SFF Timeseries I/O. /*! \brief SFF Timeseries I/O.
...@@ -113,7 +110,7 @@ namespace ts { ...@@ -113,7 +110,7 @@ namespace ts {
typedef TraceVector<C> Tbase; typedef TraceVector<C> Tbase;
typedef Tbase Ttracevector; typedef Tbase Ttracevector;
typedef typename Tbase::Ttimeseries Ttimeseries; typedef typename Tbase::Ttimeseries Ttimeseries;
typedef ts::RangeList<int> Trangelist; typedef tfxx::RangeList<int> Trangelist;
void read(datrw::idatstream& is, void read(datrw::idatstream& is,
const bool& verbose=false); const bool& verbose=false);
void read(datrw::idatstream& is, void read(datrw::idatstream& is,
......
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