Commit 1a06d46f authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

joined namespaces

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.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libdatrwxx.su
SVN Revision: 3440
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 5fcccecc
......@@ -4,7 +4,7 @@
#
# Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
#
# Makefile for libdatreadxx
# Makefile for libdatrwxx
#
# ----
# This program is free software; you can redistribute it and/or modify
......@@ -22,7 +22,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ----
#
# Other libraries that are required to compile libdatreadxx:
# Other libraries that are required to compile libdatrwxx:
# libaff, libgsexx, libtime, libsffxx
#
# REVISIONS and CHANGES
......@@ -41,7 +41,7 @@
#
all: install doxydoc
install: install-include libdatreadxx.a
install: install-include libdatrwxx.a
# ============================================================================
#
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
......@@ -60,7 +60,7 @@ LIBSRC+=$(wildcard bonjer/*.cc pdas/*.cc mseed/*.cc hpmo/*.cc sac/*.cc gse/*.cc)
TESTHEADERS=$(wildcard tests/*.h)
TESTSRC=$(wildcard tests/*.cc)
INCINSTALLPATH=$(LOCINCLUDEDIR)/datreadxx
INCINSTALLPATH=$(LOCINCLUDEDIR)/datrwxx
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off
......@@ -90,11 +90,7 @@ LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
flist: Makefile $(wildcard *.cfg contrib/*.h) $(LIBHEADERS) $(LIBSRC) \
$(TESTSRC) README \
$(wildcard ../libdatwritexx/*.h) \
$(wildcard ../libdatwritexx/*.cc) \
$(wildcard ../libdatwritexx/*/*.h) \
$(wildcard ../libdatwritexx/*/*.cc)
$(TESTSRC) README
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
......@@ -125,7 +121,7 @@ clean: ;
-include $(patsubst %.cc,%.d,$(LIBSRC) $(TESTSRC))
libdatreadxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
libdatrwxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
......@@ -178,7 +174,7 @@ install-include: $(INSTHEADER)
$(call CHECKVARS,TF_WWWBASEDIR TF_BROWSER)
DOXYWWWPATH=$(TF_WWWBASEDIR)/libdatreadxx
DOXYWWWPATH=$(TF_WWWBASEDIR)/libdatrwxx
.PHONY: doxyclean doxyview doxydoc doxyconf
......@@ -209,7 +205,7 @@ doxyview: $(DOXYWWWPATH)/html/index.html
# --------------
# is delegated to Makefile.packages
# which still has to be coded
PACKAGE=libdatreadxx
PACKAGE=libdatrwxx
#ifdef TF_MAKEPKG
#include $(TF_MAKEPKG)
#endif
......@@ -219,9 +215,9 @@ PACKAGE=libdatreadxx
# ---------
sactest hpmotest mseedtest pdastest tfasciitest\
tsofttest sfftest sutest: %: tests/%.o libdatreadxx.a
tsofttest sfftest sutest: %: tests/%.o libdatrwxx.a
$(CXX) $(FLAGS) -o $@ $< -I$(LOCINCLUDEDIR) \
-ldatreadxx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-ldatrwxx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCBINDIR)
......
/*! \file libdatreadxx/README
* \brief DATREAD++ library: reading seismic data (libdatreadxx)
/*! \file libdatrwxx/README
* \brief DATRW++ library: reading seismic data (libdatrwxx)
*
* ----------------------------------------------------------------------------
*
......@@ -7,10 +7,10 @@
*
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
*
* DATREAD++ library: reading seismic data (libdatreadxx)
* DATRW++ library: reading seismic data (libdatrwxx)
*
* This file contains:
* - documentation of namespace datread
* - documentation of namespace datrw
* - mainpage text
*
* REVISIONS and CHANGES
......@@ -26,8 +26,8 @@
It contains several subnamespaces with interfaces to format specific data
reading modules.
*/
namespace datread {
} // namespace datread
namespace datrw {
} // namespace datrw
/*======================================================================*/
......@@ -51,14 +51,14 @@ $Id$
The library provides seismic data file reading modules for several data
formats.
Functionality for all formats is provided through a common interface defined
in class datread::idatstream.
in class datrw::idatstream.
All format specific classes are derived from this base.
The class datread::ianystream has the same common interface but provides an
The class datrw::ianystream has the same common interface but provides an
inheritance transparent constructor mechanism.
Programs making use of datread::ianystream for reading seismic data will
directly benefit from each additional waveform format added to libdatreadxx
Programs making use of datrw::ianystream for reading seismic data will
directly benefit from each additional waveform format added to libdatrwxx
without the need of changing the source code of the library.
Just link against libdatreadxx and go...
Just link against libdatrwxx and go...
Currently supported formats are:
- mseed: MiniSEED (SeisComP, EDL, etc.)
......@@ -72,14 +72,14 @@ $Id$
- tfascii: output data of T. Forbriger's any2ascii
Each format specific module will be placed into its own namespace, like
datread::hpmo.
There you will find specific functions like datread::hpmo::readdata.
datrw::hpmo.
There you will find specific functions like datrw::hpmo::readdata.
The interface provided through these functions is specific to the data
format.
However, for each format we provide a class derived from
datread::idatstream, like datread::ihpmostream.
datrw::idatstream, like datrw::ihpmostream.
Being derived from a common base class all these format specific classes
provide a common interface once defined in datread::idastream.
provide a common interface once defined in datrw::idastream.
This interface handles data in terms of SFF (Stuttgart File Format) data
elements (like INFO lines and FREE blocks).
Thus the format specific input classes perform the conversion from the
......@@ -89,21 +89,21 @@ $Id$
All SFF data elements not present in the specific format must be replaced by
default values.
datread::idatstream behaves like an input stream for SFF data elements.
Appropriate input operators are presented in namespace #datread.
All derived classes and datread::ianystream provide the same interface and
datrw::idatstream behaves like an input stream for SFF data elements.
Appropriate input operators are presented in namespace #datrw.
All derived classes and datrw::ianystream provide the same interface and
operator set.
datread::ianystream is not derived from datread::idatstream.
It rather serves as a handle to any class derived from datread::idatstream.
anyway datread::ianystream provides the same interface.
Consider to use datread::sequentialtracereader instead of
datread::ianystream since it provides higher efficiency when reading several
datrw::ianystream is not derived from datrw::idatstream.
It rather serves as a handle to any class derived from datrw::idatstream.
anyway datrw::ianystream provides the same interface.
Consider to use datrw::sequentialtracereader instead of
datrw::ianystream since it provides higher efficiency when reading several
traces from the same file.
\section sec_howto HOWTO read data of any supported format
Here I provide an example on how to read seismic data using
datread::ianystream and writing it to a different file via sff::SFFostream.
datrw::ianystream and writing it to a different file via sff::SFFostream.
Consider the names of input files given in
\code
std::list<std::string> infiles;
......@@ -114,7 +114,7 @@ $Id$
\endcode
The type of the input files are given in
\code
datread::Eformat format;
datrw::Eformat format;
\endcode
which can be created from a string specifier
\code
......@@ -122,7 +122,7 @@ $Id$
\endcode
through
\code
format=datread::anyID(type);
format=datrw::anyID(type);
\endcode
We assume that a file FREE block
\code
......@@ -148,13 +148,13 @@ $Id$
// open input stream for reading next file
std::ifstream ifs(infile->c_str());
// create an interface to the input stream
datread::ianystream is(ifs, format);
datrw::ianystream is(ifs, format);
// cycle through all traces while input stream provides data
while(is.good())
{
// create a double precision series container
datread::Tdseries series;
datrw::Tdseries series;
// read and write the series
is >> series;
os << series;
......@@ -179,13 +179,13 @@ $Id$
/*! \page howtoworks How the library works
All input streams are derived from datread::idatstream.
The interface of datread::idatstream consequently defines the behaviour of all
All input streams are derived from datrw::idatstream.
The interface of datrw::idatstream consequently defines the behaviour of all
input stream classes.
datread::ianystream implements the same interface and behaviour.
datrw::ianystream implements the same interface and behaviour.
It is a general input stream, more or less, which selects one of the
implemented stream classes based on the second parameter passed to its
constructor datread::ianystream::ianystream().
constructor datrw::ianystream::ianystream().
\section sec_howtoworks_go So, what happens when you are up to read a file?
......@@ -197,13 +197,13 @@ The constructor of the input stream starts reading the file by parsing the
Before continuing by reading the trace data, the user can extract information
from the file header.
This is done by the \em file \em header \em query \em functions
\li datread::idatstream::hasfree()
\li datread::idatstream::hassrce()
\li datread::idatstream::free()
\li datread::idatstream::srce()
\li datrw::idatstream::hasfree()
\li datrw::idatstream::hassrce()
\li datrw::idatstream::free()
\li datrw::idatstream::srce()
At this stage the functions datread::idatstream::hasfree() and
datread::idatstream::free() provide access to the FREE block of the file
At this stage the functions datrw::idatstream::hasfree() and
datrw::idatstream::free() provide access to the FREE block of the file
header.
After reading the first trace, the FREE block of the file header
will no longer be accessible.
......@@ -213,19 +213,19 @@ blocks and trace FREE blocks together with input operators.
\subsection subsec_howtoworks_tracedata Reading samples from a trace
Then the user continues by reading the samples of the first trace in the file
by calling one of the \em series \em query \em functions
\li datread::idatstream::dseries()
\li datread::idatstream::fseries()
\li datread::idatstream::iseries()
\li datrw::idatstream::dseries()
\li datrw::idatstream::fseries()
\li datrw::idatstream::iseries()
These functions immediately return a container of type aff::Series of
appropriate type (as provided by typedefs datread::Tdseries,
datread::Tfseries, and datread::Tiseries).
appropriate type (as provided by typedefs datrw::Tdseries,
datrw::Tfseries, and datrw::Tiseries).
Not all of them may be provided by a specific stream class.
To check for the available types, use the \em sample \em type \em query
\em functions
\li datread::idatstream::providesd()
\li datread::idatstream::providesf()
\li datread::idatstream::providesi()
\li datrw::idatstream::providesd()
\li datrw::idatstream::providesf()
\li datrw::idatstream::providesi()
The available data types usually reflect the data types used within the data
file.
......@@ -238,16 +238,16 @@ While parsing the trace data, the input stream classes collect trace header
information.
After returning the samples, this data is available through the
\em header \em query \em functions
\li datread::idatstream::hasfree()
\li datread::idatstream::hasinfo()
\li datread::idatstream::free()
\li datread::idatstream::info()
\li datread::idatstream::wid2()
\li datrw::idatstream::hasfree()
\li datrw::idatstream::hasinfo()
\li datrw::idatstream::free()
\li datrw::idatstream::info()
\li datrw::idatstream::wid2()
A WID2 line is provided in any case, containing data like the time of the
first sample, the sampling rate and the number of samples.
Notice that the functions datread::idatstream::hasfree() and
datread::idatstream::free() now operate on the FREE block of the trace.
Notice that the functions datrw::idatstream::hasfree() and
datrw::idatstream::free() now operate on the FREE block of the trace.
\subsection subsec_howtoworks_moredata Reading the next trace
If the input provides more than one trace, the user continues to call the
......@@ -255,27 +255,27 @@ If the input provides more than one trace, the user continues to call the
trace. After returning the trace data, the header data for this trace is
available through the \em header \em query \em functions.
The \em state \em query \em functions
\li datread::idatstream::last()
\li datread::idatstream::good()
\li datrw::idatstream::last()
\li datrw::idatstream::good()
indicate whether further data can be expected in the file.
\subsection subsec_howtoworks_skip What is skipseries() for?
Some file formats produce a significant overhead when data actually is read.
One example is the class datread::imseedstream for reading MiniSEED data.
One example is the class datrw::imseedstream for reading MiniSEED data.
If the users likes to fast-forward to trace number 27, it is very inefficient
to actually decode traces 1 to 26.
In such a case calling the \em skip \em function
\li datread::idatstream::skipseries()
\li datrw::idatstream::skipseries()
for traces 1 to 26 and using one of the \em series \em query \em functions for
trace 27 only can speed up the whole procedure.
This however ist not the case for all file formats.
The classes for reading multiplexing file formats like HPMO
(datread::ihpmostream) and TSOFT (datread::itsoftstream) have to
(datrw::ihpmostream) and TSOFT (datrw::itsoftstream) have to
decode all traces at once and buffer them in internal storage in any case.
Nevertheless, datread::idatstream::skipseries() parses the header data of the
Nevertheless, datrw::idatstream::skipseries() parses the header data of the
trace and provides all the extracted information through the \em header \em
query \em functions.
For this reason, using the \em skip \em function is a convenient way to browse
......@@ -286,8 +286,8 @@ Input operators support an easy way to apply the modules in this library.
Almost all data query functions (be it header data or trace samples) can be
accessed through input operators.
This is the case for all classes.
The operators are provided in namespace ::datread.
\sa \ref sec_howto, ::datread
The operators are provided in namespace ::datrw.
\sa \ref sec_howto, ::datrw
*/
// ----- END OF README -----
......@@ -35,17 +35,17 @@
*/
// include guard
#ifndef DATWRITE_ASCII_H_VERSION
#ifndef DATRW_ASCII_H_VERSION
#define DATWRITE_ASCII_H_VERSION \
#define DATRW_ASCII_H_VERSION \
"TF_ASCII_H V1.0 "
#define DATWRITE_ASCII_H_CVSID \
#define DATRW_ASCII_H_CVSID \
"$Id$"
namespace datwrite {
namespace datrw {
} // namespace datwrite
} // namespace datrw
#endif // DATWRITE_ASCII_H_VERSION (includeguard)
#endif // DATRW_ASCII_H_VERSION (includeguard)
/* ----- END OF ascii.h ----- */
......@@ -35,14 +35,14 @@
*/
// include guard
#ifndef DATWRITE_BINARY_H_VERSION
#ifndef DATRW_BINARY_H_VERSION
#define DATWRITE_BINARY_H_VERSION \
"DATWRITE_BINARY_H V1.0 "
#define DATWRITE_BINARY_H_CVSID \
#define DATRW_BINARY_H_VERSION \
"DATRW_BINARY_H V1.0 "
#define DATRW_BINARY_H_CVSID \
"$Id$"
namespace datwrite {
namespace datrw {
/*! \brief binary writing interface
*
......@@ -69,8 +69,8 @@ namespace datwrite {
static const char* const Mmagic;
}; // class obinarystream
} // namespace datwrite
} // namespace datrw
#endif // DATWRITE_BINARY_H_VERSION (includeguard)
#endif // DATRW_BINARY_H_VERSION (includeguard)
/* ----- END OF binary.h ----- */
......@@ -34,16 +34,16 @@
*/
// include guard
#ifndef DATREAD_BONJER_H_VERSION
#ifndef DATRW_BONJER_H_VERSION
#define DATREAD_BONJER_H_VERSION \
"DATREAD_BONJER_H V1.0 "
#define DATREAD_BONJER_H_CVSID \
#define DATRW_BONJER_H_VERSION \
"DATRW_BONJER_H V1.0 "
#define DATRW_BONJER_H_CVSID \
"$Id$"
#include<datreadxx/datread.h>
#include<datrwxx/datrw.h>
namespace datread {
namespace datrw {
/*! \brief input stream to read seismic data provided by K. Bonjer
*
......@@ -68,8 +68,8 @@ namespace datread {
void readheader();
}; // class ibonjerstream
} // namespace datread
} // namespace datrw
#endif // DATREAD_BONJER_H_VERSION (includeguard)
#endif // DATRW_BONJER_H_VERSION (includeguard)
/* ----- END OF bonjer.h ----- */
......@@ -33,15 +33,15 @@
*
* ============================================================================
*/
#define DATREAD_BONJER_CC_VERSION \
"DATREAD_BONJER_CC V1.1"
#define DATREAD_BONJER_CC_CVSID \
#define DATRW_BONJER_CC_VERSION \
"DATRW_BONJER_CC V1.1"
#define DATRW_BONJER_CC_CVSID \
"$Id$"
#include <datreadxx/bonjer.h>
#include <datreadxx/readbonjer.h>
#include <datrwxx/bonjer.h>
#include <datrwxx/readbonjer.h>
namespace datread {
namespace datrw {
ibonjerstream::ibonjerstream(std::istream& is): Tbase(is, true, true, true)
{ }
......@@ -55,7 +55,7 @@ namespace datread {
double inval;
for (int i=0; i<n; ++i)
{
DATREAD_assert(is.good(),"ERROR (ibonjerstream::?series): "
DATRW_assert(is.good(),"ERROR (ibonjerstream::?series): "
"bad stream!");
is >> inval;
retval(i)=typename C::Tvalue(inval);
......@@ -93,7 +93,7 @@ namespace datread {
void ibonjerstream::readheader()
{
datread::bonjer::header hd=datread::bonjer::readheader(Mis);
datrw::bonjer::header hd=datrw::bonjer::readheader(Mis);
sff::FREE tracefree;
sff::WID2 wid2;
this->newtrace();
......@@ -114,6 +114,6 @@ namespace datread {
this->setwid2(wid2);
}
} // namespace datread
} // namespace datrw
/* ----- END OF bonjer.cc ----- */
......@@ -32,16 +32,16 @@
*
* ============================================================================
*/
#define DATREAD_READBONJER_CC_VERSION \
"DATREAD_READBONJER_CC V1.0 "
#define DATREAD_READBONJER_CC_CVSID \
#define DATRW_READBONJER_CC_VERSION \
"DATRW_READBONJER_CC V1.0 "
#define DATRW_READBONJER_CC_CVSID \
"$Id$"
#include<cstdlib>
#include<sstream>
#include<datreadxx/readbonjer.h>
#include<datrwxx/readbonjer.h>
namespace datread {
namespace datrw {
/*!
* To provide a definition of the data format, we dump
......@@ -166,6 +166,6 @@ Units: CM/S**2
} // namespace bonjer
} // namespace datread
} // namespace datrw
/* ----- END OF readbonjer.cc ----- */
......@@ -34,18 +34,18 @@
*/
// include guard
#ifndef DATREAD_READBONJER_H_VERSION
#ifndef DATRW_READBONJER_H_VERSION
#define DATREAD_READBONJER_H_VERSION \
"DATREAD_READBONJER_H V1.0 "
#define DATREAD_READBONJER_H_CVSID \
#define DATRW_READBONJER_H_VERSION \
"DATRW_READBONJER_H V1.0 "
#define DATRW_READBONJER_H_CVSID \
"$Id$"
#include<aff/series.h>
#include<iostream>
#include<libtime++.h>
namespace datread {
namespace datrw {
/*! \brief all functions, classes, etc. to read K. Bonjers data format
*
......@@ -80,8 +80,8 @@ namespace datread {
} // namespace bonjer
} // namespace datread
} // namespace datrw
#endif // DATREAD_READBONJER_H_VERSION (includeguard)
#endif // DATRW_READBONJER_H_VERSION (includeguard)
/* ----- END OF readbonjer.h ----- */
......@@ -8,7 +8,7 @@
* \date 29/06/2007
*
* a copy of libtfxx ioswap.cc (implementation)
* just to make libdatread more independent
* just to make libdatrw more independent
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -34,19 +34,19 @@
*
* ============================================================================
*/
#define TF_DATREAD_BYTESEX_CC_VERSION \
"TF_DATREAD_BYTESEX_CC V1.1"
#define TF_DATREAD_BYTESEX_CC_CVSID \
#define TF_DATRW_BYTESEX_CC_VERSION \
"TF_DATRW_BYTESEX_CC V1.1"
#define TF_DATRW_BYTESEX_CC_CVSID \
"$Id$"
#include <datreadxx/bytesex.h>
#include <datreadxx/error.h>
#include <datrwxx/bytesex.h>
#include <datrwxx/error.h>
#include <iostream>
using std::cout;
using std::endl;
namespace datread {
namespace datrw {
namespace util {
......@@ -77,7 +77,7 @@ namespace datread {
{
Ecpu_type result=cpu_unknown;
IOUnion<int> u1,u2;
DATREAD_assert((sizeof(int) == 4),
DATRW_assert((sizeof(int) == 4),
"The integer memory size on this CPU differs from the"
"required value of 4");
const int& intsize=sizeof(int);
......@@ -141,6 +141,6 @@ namespace datread {
} // namespace util
} // namespace datread
} // namespace datrw
/* ----- END OF bytesex.cc ----- */
......@@ -9,7 +9,7 @@
*
* A copy of bytesex.h from libtfxx (prototypes)
*
* just to make libdatread a bit more independent
* just to make libdatrw a bit more independent
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -37,18 +37,18 @@
*/
// include guard
#ifndef TF_DATREAD_BYTESEX_H_VERSION
#ifndef TF_DATRW_BYTESEX_H_VERSION
#define TF_DATREAD_BYTESEX_H_VERSION \
"TF_DATREAD_BYTESEX_H V1.1"
#define TF_DATREAD_BYTESEX_H_CVSID \
#define TF_DATRW_BYTESEX_H_VERSION \
"TF_DATRW_BYTESEX_H V1.1"
#define TF_DATRW_BYTESEX_H_CVSID \
"$Id$"
// we include fstream, because all function are closely related to file I/O
// and file_magic definitely requires fstream
#include<fstream>
namespace datread {
namespace datrw {
namespace util {
......@@ -68,7 +68,7 @@ namespace datread {
* \sa group_fortranio
* \sa bytesex_h
*
* The components are collected in namespace datread::util.
* The components are collected in namespace datrw::util.
* @{
*/
......@@ -203,8 +203,8 @@ namespace datread {