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

[MERGE][FIX][API] (ticket10): provide libtsioxx

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.

merge with commit ticket10tsio:

  0351ae8 [WP][TASK] (ticket10tsio): add libtsioxx to list of libraries
  68fc76b [WP][DOC] (ticket10tsio): register dependencies
  5377e47 [WP][DOC] (ticket10tsio): provide meaningful doxygen documentation
  369ebfd [WP][TASK] (ticket10tsio): provide snapshot packages
  78c270b [WP][DOC] (ticket10tsio): provide documentation in README
  252b7ec [WP][TASK][FIX] (ticket10tsio): provide required header files
  8f87837 [WP][TASK] (ticket10tsio): reorganize source code files
  7f948a3 [WP][TASK] (ticket10tsio): reorganize source code files
  6cab80f [WP][TASK] (ticket10tsio): reorganize source code files
  f7a7584 [WP][DOC] (ticket10tsio): document gross structure of modules
  37eb265 [WP][DOC] (ticket10tsio): provide stocktaking in the documentation

In the process of disentangling libtfxx and libtsxx file input/output
functions for timeseries and data file classes were moved to a new library.
This library (libtsioxx) is now properly ordered and basically document. It
compiles well and snapshot packages are provided.

Next steps:
  Adjust application programs, such that the use the new interface.
parents 615b5c6c a29dccb0
......@@ -133,7 +133,16 @@ C++ libraries
libraries: libtfxx.a
external dependencies: libgsl libboost
internal dependencies: -
checked: 28.10.2014 (tforb)
checked: 28.01.2014 (tforb)
libtsioxx
language: C++
libraries: libtsiofxx.a
external dependencies: -
indirect external dependencies: libgsl libboost
internal dependencies: libtsxx, libaff, libsffxx, libtime, libgsexx,
libtfxx, libdatrwxx
indirect internal dependencies: libseife
checked: 31.01.2014 (tforb)
C++ and C libraries
-------------------
......
......@@ -55,6 +55,11 @@
# 19/12/2007 V1.2 first install headers then compile
# first remove .d-files then the rest
# 12/01/2010 V1.3 provide target install for consistency
# 31/01/2014 added libtsioxx, re-ordered flist entries
#
# TODO
# re-adjust package rules, now that mutual dependency between libtsxx and
# libtfxx has gone.
#
# ============================================================================
#
......@@ -80,14 +85,16 @@ LIBDIRS=libaff \
librheology \
libstfinv \
libttsynt \
libserialxx
libserialxx \
libtsioxx
# libraries with snapshot package make rules
PACKAGEDIRS=libaff \
libtime \
libsff \
libdatrwxx \
libstfinv
libstfinv \
libtsioxx
TARGETS=$(addsuffix .install,$(LIBDIRS))
REINSTALL=$(addsuffix .reinstall,$(LIBDIRS))
......@@ -111,8 +118,15 @@ packages: $(PACKAGETARGETS)
.PHONY: show
show: ; @echo $(TARGETS)
flist: $(shell find . -name Makefile) $(TF_EDIT)
echo $^ | tr ' ' '\n' | sort > $@
ALLMAKEFILES=$(patsubst ./%,%,$(shell find . -name Makefile))
flist: $(ALLMAKEFILES) $(TF_EDIT)
echo Makefile | tr ' ' '\n' | sort > $@
echo '----' >> $@
echo $(filter-out Makefile,$(ALLMAKEFILES)) \
| tr ' ' '\n' | sort >> $@
echo '----' >> $@
echo $(filter-out $(ALLMAKEFILES),$^) \
| tr ' ' '\n' | sort >> $@
.PHONY: edit
edit: flist; vim $<
......
......@@ -5,10 +5,10 @@ libsioxx C++ time series file input/ouput
$Id: COPYING 4960 2013-02-01 09:02:16Z tforb $
============================================================================
The source code in this directory is part of libtfxx which
compiles libtfxx.a
The source code in this directory is part of libtsioxx which
compiles libtsioxx.a
Copyright (C) 2005, 2007, 2013, 2014 by Thomas Forbriger
Copyright (C) 2005-2007, 2011-2014 by Thomas Forbriger
----
libtsioxx is free software; you can redistribute it and/or modify
......
......@@ -48,14 +48,20 @@ INCINSTALLPATH=$(LOCINCLUDEDIR)/tsioxx
INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(notdir $(HEADERS)))
FLAGS+=-fPIC $(MYFLAGS)
CXXFLAGS+=-fhonor-std -Wall $(FLAGS)
CXXFLAGS+= -Wall $(FLAGS)
CXXFLAGS+=$(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR) $(TF_LINK_REGEXX)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS) $(REGEXXFLAG)
flist: Makefile doxydoc.cfg COPYING README $(DOXYTXT) \
$(HEADERS) $(SRC) $(TF_EDIT)
echo $^ | tr ' ' '\n' | sort > $@
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
CODEFILES=$(HEADERS) $(SRC)
OTHERFILES=Makefile doxydoc.cfg COPYING README $(DOXYTXT)
flist: $(CODEFILES) $(OTHERFILES) $(TF_EDIT)
echo $(OTHERFILES) | tr ' ' '\n' | sort > $@
echo '----' >> $@
echo $(CODEFILES) | tr ' ' '\n' | sort >> $@
echo '----' >> $@
echo $(filter-out $(CODEFILES) $(OTHERFILES),$^) \
| tr ' ' '\n' | sort >> $@
.PHONY: edit
edit: flist; vim $<
......@@ -66,7 +72,6 @@ clean: ;
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o install-include *.strip libtfxx.a *.a *.so *.xxx
cd tests; $(MAKE) clean
#======================================================================
# dependencies
......@@ -78,7 +83,7 @@ clean: ;
> $@; \
[ -s $@ ] || rm -f $@'
include $(patsubst %.cc,%.d,$(SRC) $(TESTS))
include $(patsubst %.cc,%.d,$(SRC))
#======================================================================
# library part
......@@ -171,7 +176,7 @@ ifdef TF_MAKEPKG
package: $(TF_MAKEPKG)
$(MAKE) -f $< \
PACKAGE=libtsioxx \
PACKAGEEXPORT="trunk/src/libs/libtfxx:src" \
PACKAGEEXPORT="trunk/src/libs/libtsioxx:src" \
PACKAGETARGETS="src:install:-i src:doc" \
PACKAGELIBS="-"
......@@ -182,9 +187,9 @@ package: $(TF_MAKEPKG)
fullpackage: $(TF_MAKEPKG)
$(MAKE) -f $< \
PACKAGE=libtsioxxwithlibs \
PACKAGEEXPORT="trunk/src/libs/libtfxx:src trunk/src/libs/libtsxx:contrib/libtsxx" \
PACKAGETARGETS="contrib/libtsxx:install:-i src:install:-i contrib/libtsxx:reinstall contrib/libtsxx:doc:-i src:all" \
PACKAGELIBS="libgsexx:libtime:libsffxx:libaff:libseife:libdatrwxx"
PACKAGEEXPORT="trunk/src/libs/libtsioxx:src" \
PACKAGETARGETS="src:all" \
PACKAGELIBS="libgsexx:libtime:libsffxx:libaff:libseife:libdatrwxx:libtsxx:libtfxx"
endif
# ----- END OF Makefile -----
......@@ -5,18 +5,60 @@ libsioxx C++ time series file input/ouput
$Id$
============================================================================
The home of this software suite is
http://gpitrsvn.gpi.uni-karlsruhe.de:8000/TFSoftware/wiki/trunk/src/libs/libtsioxx
Purpose
-------
This library is based on libtsxx which provides tools and utilities for time
series analysis and processing which refer to a given sampling interval of the
time series. libtsxx for this reason provides a ts::TimeSeries class template,
for objects storing sample values along with the sampling interval. The
current library (libtsioxx) inherits from this template to provide a
ts::sff::SFFTimeSeries class template for objects storing sample values along
with full qualified SFF headers (stored in ts::sff::TraceHeader objects) and
which are valid ts::TimeSeries objects at the same time.
For compilation instructions see README.1st in the root directory of the
tar-ball or
http://gpitrsvn.gpi.uni-karlsruhe.de:8000/TFSoftware/wiki/docs/installation
Based on ts::sff::SFFTimeSeries libtsioxx provides ts::sff::TraceVector with
publically inherits from the STL vector and provides an object to store
several ts::sff::SFFTimeSeries objects. This, together with
ts::sff::FileHeader, is used to compile the class template ts::sff::File,
which is able to store complete data files.
Please send bug reports and suggestions to
Thomas.Forbriger@kit.edu
Further libtsioxx provides input/output operators for the above mentioned
classes to be read from or written two libdatrwxx streams. Reading functions
wich provide a rangelist selection for input traces are provided too.
At the highest level of complexity, classes ts::sff::SFile and ts::sff::DFile
are provided together with file reading functions. These classes are meant to
store a complete set of data files as defined on the command line of
application programs together with file specific parameters. A set of such
files can be stored in ts::sff::TSFileList and ts::sff::TDFileList objects,
which basically are typedefs referring to the STL list container. File input
for these objects is supported for reading from libdatrwxx input streams.
Interfaces
----------
sfftimeseries.h
ts::sff::SFFTimeSeries class template
sfftsfile.h
ts::sff::File class template
inputoperators.h
outputoperators.h
input and output operators for ts::sff::SFFTimeSeries and ts::sff::File
SFFoutputoperators.h
deprecated output operators to SFF files (still provided for backward
compatibility)
cmdlinefiles.h
ts::sff::SFile and ts::sff::DFile and reading functions
Installation instructions
-------------------------
For compilation instructions see README.1st in the root directory of the
tar-ball or
http://gpitrsvn.gpi.uni-karlsruhe.de:8000/TFSoftware/wiki/docs/installation
The command make all will compile and install the binary executables
as well as the doxygen documentation.
......@@ -36,17 +78,25 @@ Dependencies:
doxygen (required to process source code documentation)
TFSoftware libraries required to compile the code:
? direct dependencies:
? libtsxx, libaff, libsffxx, libtime, libgsexx
? indirect dependencies:
? libseife, libdatrwxx
external dependencies:
libgsl libboost (through libtfxx)
libgsl (through libtsxx)
direct dependencies:
libtsxx, libaff, libsffxx, libtime, libgsexx, libtfxx,
libdatrwxx
indirect dependency:
libseife (through libtsxx)
Further non-standard libraries required to compile the code:
- the C++ standard template library (STL)
Tests and examples are provided in subdirectory tests
Source code documentation is provided through doxygen.
See target doxydoc in the Makefile.
Detailed documentation is provided through doxygen source code. See target
doxydoc in the Makefile.
The home of this software suite is
http://gpitrsvn.gpi.uni-karlsruhe.de:8000/TFSoftware/wiki/trunk/src/libs/libtsioxx
Please send bug reports and suggestions to
Thomas.Forbriger@kit.edu
----- END OF README -----
/*! \file SFFoutputoperators.h
* \brief deprecated output operators to libsffxx output stream (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: $
* \author Thomas Forbriger
* \since 18/07/2005
* \date 30/01/2014
*
* deprecated output operators to libsffxx output stream (prototypes)
*
* 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.h
*
* ============================================================================
*/
// include guard
#ifndef TSIO_SFFOUTPUTOPERATORS_H_VERSION
#define TSIO_SFFOUTPUTOPERATORS_H_VERSION \
"TF_SFFOUTPUTOPERATORS_H 2014/01/30"
#define TSIO_SFFOUTPUTOPERATORS_H_CVSID \
"$Id: $"
#warning Use of this module is deprecated.
#warning Better use outputoperators.h for libdatrwxx streams.
#include<tsioxx/sfftsfile.h>
#include<sffostream.h>
namespace ts {
namespace sff {
/*! \brief libsffxx output operators
* \defgroup group_SFFoutputoperators libsffxx output operators
*
* This module is presented through SFFoutputoperators.h
*
* \deprecated
* This interface should no longer be used.
* The interface provided by outputoperators.h for output to libdatrwxx
* file streams is much more flexible.
*
* @{
*/
/*======================================================================*/
// sff::SFFostream output operators
template<class C>
::sff::SFFostream<C>& operator<<(::sff::SFFostream<C>& os,
const FileHeader& fh)
{
if (fh.hasfree()) { os << fh.free(); }
if (fh.hassrce()) { os << fh.srce(); }
return os;
}
/*----------------------------------------------------------------------*/
template<class C>
::sff::SFFostream<C>& operator<<(::sff::SFFostream<C>& 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>
::sff::SFFostream<C>& operator<<(::sff::SFFostream<C>& os,
const typename SFFTimeSeries<C>::Tconsttimeseries& s)
{
typedef typename SFFTimeSeries<C>::Tconsttimeseries::Tseries Tseries;
return(os << Tseries(s) << s.header);
}
/*----------------------------------------------------------------------*/
template<class C>
::sff::SFFostream<C>& operator<<(::sff::SFFostream<C>& os,
const SFFTimeSeries<C>& s)
{
typedef typename SFFTimeSeries<C>::Tcoc Tcoc;
return(os << Tcoc(s) << s.header);
}
/*----------------------------------------------------------------------*/
template<class C>
::sff::SFFostream<C>& operator<<(::sff::SFFostream<C>& 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>
::sff::SFFostream<C>& operator<<(::sff::SFFostream<C>& os,
const File<C>& f)
{ return(os << f.fileheader << TraceVector<C>(f)); }
/*!
* @}
*/
} // namespace sff
} // namespace ts
#endif // TSIO_SFFOUTPUTOPERATORS_H_VERSION (includeguard)
/* ----- END OF SFFoutputoperators.h ----- */
/*! \file readtsdata.cc
* \brief read waveform data through the interface provided by libdatrwxx
* (implementation)
/*! \file cmdlinefiles.cc
* \brief containers for data files with file specific command line parameters (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id$
* $Id: $
* \author Thomas Forbriger
* \date 31/01/2007
* \since 31/01/2007
* \date 30/01/2014
*
* read waveform data through the interface provided by libdatrwxx
* containers for data files with file specific command line parameters
* (implementation)
*
* Copyright (c) 2007, 2010, 2011, 2014 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -26,27 +28,26 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
* Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
*
*
* REVISIONS and CHANGES
* - 31/01/2007 V1.0 Thomas Forbriger
* - 31/10/2007 V1.1 added single precision versions
* PGPLOT requires single precision data
* - 25/11/2010 V1.2 use correct open mode upon opening an ifstream
* - 09/09/2011 V1.3 support file format modifiers
* - 30/01/2014 V1.0 Thomas Forbriger (thof):
* copied from readtsdata.cc
*
* ============================================================================
*/
#define TSIOXX_READTSDATA_CC_VERSION \
"TSIOXX_READTSDATA_CC V1.3"
#define TSIOXX_READTSDATA_CC_CVSID \
"$Id$"
#define TSIO_CMDLINEFILES_CC_VERSION \
"TF_CMDLINEFILES_CC 2014/01/30"
#define TSIO_CMDLINEFILES_CC_CVSID \
"$Id: $"
#include <fstream>
#include <tsioxx/cmdlinefiles.h>
#include <tsioxx/inputoperators.h>
#include <tfxx/rangestring.h>
#include <tsioxx/readtsdata.h>
namespace ts {
namespace tsio {
namespace file {
namespace sff {
//! read complete SFF file
SFile readSSFF(const std::string& filename,
......@@ -250,7 +251,7 @@ namespace tsio {
return (readDSFF(flist, verbose, tracekey, datrw::anyID(format)));
}
} // namespace file
} // namespace tsio
} // namespace sff
} // namespace ts
/* ----- END OF readtsdata.cc ----- */
/* ----- END OF cmdlinefiles.cc ----- */
/*! \file readtsdata.h
* \brief read waveform data through the interface provided by libdatrwxx
* (prototypes)
/*! \file cmdlinefiles.h
* \brief containers for data files with file specific command line parameters
* (prototypes).
*
* ----------------------------------------------------------------------------
*
* $Id$
* $Id: $
* \author Thomas Forbriger
* \date 31/01/2007
* \since 31/01/2007
* \date 30/01/2014
*
* Copyright (c) 2007, 2010, 2011, 2014 by Thomas Forbriger (BFO Schiltach)
*
* read waveform data through the interface provided by libdatrwxx
* containers for data files with file specific command line parameters
* (prototypes)
*
* ----
......@@ -26,48 +29,37 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
* Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
*
*
* REVISIONS and CHANGES
* - 31/01/2007 V1.0 Thomas Forbriger
* - 31/10/2007 V1.1 added single precision versions
* PGPLOT requires single precision data
* - 09/09/2011 V1.2 support file format modifiers
* - 30/01/2014 V1.0 Thomas Forbriger (thof):
* copied from readtsdata.h
*
* ============================================================================
*/
// include guard
#ifndef TSIOXX_READTSDATA_H_VERSION
#ifndef TSIO_CMDLINEFILES_H_VERSION
#define TSIOXX_READTSDATA_H_VERSION \
"TSIOXX_READTSDATA_H V1.2"
#define TSIOXX_READTSDATA_H_CVSID \
"$Id$"
#define TSIO_CMDLINEFILES_H_VERSION \
"TF_CMDLINEFILES_H 2014/01/30"
#define TSIO_CMDLINEFILES_H_CVSID \
"$Id: $"
#include<tfxx/rangelist.h>
#include<tsioxx/sfftsfile.h>
#include<tfxx/xcmdline.h>
#include<tfxx/rangestring.h>
#include<datrwxx/readany.h>
#include<tsioxx/sffheaders.h>
#include<iostream>
#include<fstream>
/*! \defgroup group_readtsdata Reading of time series data.
* \brief Read a complete set of time series including the selection of
* traces.
*
* The module is presented in namespace tfxx::tsio.
*
*/
namespace ts {
namespace tsio {
/*! \namespace tfxx::tsio
* \brief Namespace containing all components of module readtsdata.
* \ingroup group_readtsdata, readtsdata_h
*/
namespace file {
namespace sff {
/*! \brief Full commandline data file parsing
* \defgroup group_cmdlinefiles Full commandline data file parsing
*
* This module is presented through cmdlinefiles.h
*
* @{
*/
/*! \brief type of trace selection list.
*
......@@ -507,9 +499,9 @@ namespace tsio {
Ttracelistkey tracekey="t",
const datrw::Eformat& format=datrw::Fsff);
} // namespace file
} // namespace tsio
} // namespace sff
} // namespace ts
#endif // TSIOXX_READTSDATA_H_VERSION (includeguard)
#endif // TSIO_CMDLINEFILES_H_VERSION (includeguard)
/* ----- END OF readtsdata.h ----- */
/* ----- END OF cmdlinefiles.h ----- */
......@@ -32,18 +32,53 @@
/*! \mainpage
\copyright Copyright (c) 2013 by Thomas Forbriger (BFO Schiltach)
\author Thomas Forbriger
\since January 2014
\date January 2014
$Id$
\section main_aims Aims
\subsection main_sub_purpose Purpose
This library provides modules for time series input/output.
Some of the functionality for SFF i/o is from a pre-libdatrwxx aera and should
be updated.
Other functionality provides the input and output of complete data files with
trace selection in one line of code.
This library is based on libtsxx which provides tools and utilities for time
series analysis and processing which refer to a given sampling interval of the
time series. libtsxx for this reason provides a ts::TimeSeries class template,
for objects storing sample values along with the sampling interval. The
current library (libtsioxx) inherits from this template to provide a
ts::sff::SFFTimeSeries class template for objects storing sample values along
with full qualified SFF headers (stored in ts::sff::TraceHeader objects) and
which are valid ts::TimeSeries objects at the same time.
Based on ts::sff::SFFTimeSeries libtsioxx provides ts::sff::TraceVector with
publically inherits from the STL vector and provides an object to store
several ts::sff::SFFTimeSeries objects. This, together with
ts::sff::FileHeader, is used to compile the class template ts::sff::File,
which is able to store complete data files.
Further libtsioxx provides input/output operators for the above mentioned
classes to be read from or written two libdatrwxx streams. Reading functions
wich provide a rangelist selection for input traces are provided too.
At the highest level of complexity, classes ts::sff::SFile and ts::sff::DFile
are provided together with file reading functions. These classes are meant to
store a complete set of data files as defined on the command line of
application programs together with file specific parameters. A set of such
files can be stored in ts::sff::TSFileList and ts::sff::TDFileList objects,
which basically are typedefs referring to the STL list container. File input
for these objects is supported for reading from libdatrwxx input streams.
\subsection main_sub_interfaces Interfaces
\par \c sfftimeseries.h:
ts::sff::SFFTimeSeries class template
\par \c sfftsfile.h:
ts::sff::File class template
\par \c inputoperators.h, \c outputoperators.h:
input and output operators for ts::sff::SFFTimeSeries and ts::sff::File
\par \c SFFoutputoperators.h: