Commit 8bfca27d authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

proceeding

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/trunk
SVN Revision: 2983
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent db36bdf8
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.3 2010-02-17 21:58:26 tforb Exp $
# $Id: Makefile,v 1.4 2010-02-20 22:05:29 tforb Exp $
#
# Copyright (c) 2006 by Thomas Forbriger (BFO Schiltach)
#
......@@ -28,12 +28,13 @@
# ============================================================================
#
MODULES=sff ascii
MODULES=sff
HEADERS=$(wildcard *.h $(addsuffix /*.h,$(MODULES)))
LIBSRC=$(wildcard *.cc $(addsuffix /*.cc,$(MODULES)))
TESTSRC=$(wildcard test/*.cc)
TESTSRC=$(wildcard tests/*.cc)
INCINSTALLPATH=$(LOCINCLUDEDIR)/datwritexx
LIBINSTALLPATH=$(LOCLIBDIR)
......@@ -102,7 +103,7 @@ clean: ;
-include $(patsubst %.cc,%.d,$(LIBSRC) $(TESTSRC))
libdatreadxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
libdatwritexx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
......@@ -167,7 +168,7 @@ doxyview: doxyfullview doxybrief
# test code
# ---------
hpmotest mseedtest pdastest: %: tests/%.o libdatwritexx.a
writetest: %: tests/%.o libdatwritexx.a
$(CXX) $(FLAGS) -o $@ $< -I$(LOCINCLUDEDIR) \
-ldatwritexx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-L$(LOCLIBDIR)
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: bytesex.cc,v 1.3 2010-02-17 22:13:29 tforb Exp $
* $Id: bytesex.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2010
*
......@@ -36,7 +36,7 @@
#define DATWRITE_BYTESEX_CC_VERSION \
"TF_BYTESEX_CC V1.0 "
#define DATWRITE_BYTESEX_CC_CVSID \
"$Id: bytesex.cc,v 1.3 2010-02-17 22:13:29 tforb Exp $"
"$Id: bytesex.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $"
#include <datwritexx/bytesex.h>
#include <datwritexx/error.h>
......@@ -76,7 +76,7 @@ namespace datwrite {
{
Ecpu_type result=cpu_unknown;
IOUnion<int> u1,u2;
DATREAD_assert((sizeof(int) == 4),
DATWRITE_assert((sizeof(int) == 4),
"The integer memory size on this CPU differs from the"
"required value of 4");
const int& intsize=sizeof(int);
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: datwrite.cc,v 1.6 2010-02-20 11:05:43 tforb Exp $
* $Id: datwrite.cc,v 1.7 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -36,13 +36,13 @@
#define DATWRITE_DATWRITE_CC_VERSION \
"TF_DATWRITE_CC V1.0 "
#define DATWRITE_DATWRITE_CC_CVSID \
"$Id: datwrite.cc,v 1.6 2010-02-20 11:05:43 tforb Exp $"
"$Id: datwrite.cc,v 1.7 2010-02-20 22:05:29 tforb Exp $"
#include <datwritexx/datwrite.h>
namespace datwrite {
odatstream::odatstream(std::ostream& os);
odatstream::odatstream(std::ostream& os):
Mos(os), Mwid2set(false), Msrceset(false), Minfoset(false),
Mfreeset(false), Mheaderflushed(false)
{
......@@ -133,7 +133,7 @@ namespace datwrite {
/*----------------------------------------------------------------------*/
void odatstream::help(std::ostream& os, char* name)
void odatstream::help(std::ostream& os, const char* name)
{
os << "Class " << name << " provides no help text." << std::endl;
}
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: datwrite.h,v 1.7 2010-02-20 11:05:43 tforb Exp $
* $Id: datwrite.h,v 1.8 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -40,7 +40,12 @@
#define DATWRITE_DATWRITE_H_VERSION \
"TF_DATWRITE_H V1.0 "
#define DATWRITE_DATWRITE_H_CVSID \
"$Id: datwrite.h,v 1.7 2010-02-20 11:05:43 tforb Exp $"
"$Id: datwrite.h,v 1.8 2010-02-20 22:05:29 tforb Exp $"
#include<iostream>
#include<aff/series.h>
#include<sffxx.h>
#include<datwritexx/error.h>
namespace datwrite {
......@@ -82,37 +87,38 @@ namespace datwrite {
void setsrce(const sff::SRCE& srce);
void setinfo(const sff::INFO& info);
//! write double data
void writeseries(const Tdseries& series)
void writeseries(const Tdseries& series);
//! write single precision float data
void writeseries(const Tfseries& series)
void writeseries(const Tfseries& series);
//! write integer data
void writeseries(const Tiseries& series)
void writeseries(const Tiseries& series);
//! flush file header to file
void flushfileheader();
//! print some info about data conversion.
static void help(std::ostream& os=std::cout,
char* name="idatsream");
const char* name="idatsream");
protected:
//! constructor is protected: do not create an instance of this class
odatstream(std::ostream& os);
//! write double data
virtual void writetrace(const Tdseries& series) { DATWRITE_illegal; }
//! write single precision float data
virtual void writetrace(const Tfseries& series) { DATWRITE_illegal; }
//! write integer data
virtual void writetrace(const Tiseries& series) { DATWRITE_illegal; }
//! constructor is protected: do not create an instance of this class
odatstream(std::ostream& os);
//! output stream to be used by this class
std::ostream& Mos;
//! actually write the file header
virtual void writefileheader();
//! clear trace header flags
void cleartraceheader();
private:
//! output stream to be used by this class
std::ostream& Mos;
sff::WID2 Mwid2;
sff::SRCE Msrce;
sff::INFO Minfo;
sff::FREE Mfree;
bool Mwid2set, Msrceset, Minfoset, Mfreeset;
private:
bool Mheaderflushed;
}; // class odatstream
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: error.h,v 1.2 2006-04-11 07:42:48 tforb Exp $
* $Id: error.h,v 1.3 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -39,7 +39,7 @@
#define DATWRITE_ERROR_H_VERSION \
"DATWRITE_ERROR_H V1.0 "
#define DATWRITE_ERROR_H_CVSID \
"$Id: error.h,v 1.2 2006-04-11 07:42:48 tforb Exp $"
"$Id: error.h,v 1.3 2010-02-20 22:05:29 tforb Exp $"
namespace datwrite {
......@@ -126,7 +126,7 @@ namespace datwrite {
* \param C assert condition
* \param M message of type char*
*/
#define DATWRITE_assert(C,M) datwrite_Xassert( C , M , datwrite::Exception )
#define DATWRITE_assert(C,M) DATWRITE_Xassert( C , M , datwrite::Exception )
/*! \brief Abort and give a message.
*
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.h,v 1.3 2010-02-20 11:05:43 tforb Exp $
* $Id: sff.h,v 1.4 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -40,7 +40,11 @@
#define DATWRITE_SFF_H_VERSION \
"TF_SFF_H V1.0 "
#define DATWRITE_SFF_H_CVSID \
"$Id: sff.h,v 1.3 2010-02-20 11:05:43 tforb Exp $"
"$Id: sff.h,v 1.4 2010-02-20 22:05:29 tforb Exp $"
#include<datwritexx/datwrite.h>
#include<sffxx.h>
#include<sffostream.h>
namespace datwrite {
......@@ -58,14 +62,14 @@ namespace datwrite {
typedef odatstream Tbase;
osffstream(std::ostream& os, const bool& debug=false);
virtual ~osffstream() { }
static void help(std::ostream& os=std::cout)
{ Tbase::help(os, "osffstream"); }
static void help(std::ostream& os=std::cout);
protected:
virtual void writefileheader();
virtual void writetrace(const Tdseries& series);
virtual void writetrace(const Tfseries& series);
virtual void writetrace(const Tiseries& series);
private:
sff::SFFostream Msffos;
bool Mdebug;
}; // class osffstream
......@@ -86,6 +90,7 @@ namespace datwrite {
virtual void writefileheader();
virtual void writetrace(const Tiseries& series);
private:
bool Msffos;
bool Mdebug;
}; // class ogsestream
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.cc,v 1.3 2010-02-20 11:05:43 tforb Exp $
* $Id: sff.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -36,46 +36,74 @@
#define DATWRITE_SFF_CC_VERSION \
"TF_SFF_CC V1.0 "
#define DATWRITE_SFF_CC_CVSID \
"$Id: sff.cc,v 1.3 2010-02-20 11:05:43 tforb Exp $"
"$Id: sff.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $"
#include <datwritexx/sff.h>
#include <datwritexx/util.h>
namespace datwrite {
osffstream::osffstream(std::ostream& os, const bool& debug)
osffstream::osffstream(std::ostream& os, const bool& debug):
Tbase(os),
Msffos(os, debug),
Mdebug(debug)
{
Mdebug=debug;
DATWRITE_debug(Mdebug, "osffstream::osffstream",
"new instance established");
} // osffstream::osffstream(std::ostream& os, const bool& debug)
/*----------------------------------------------------------------------*/
void osffstream::help(std::ostream& os=std::cout)
void osffstream::help(std::ostream& os)
{
os << "This module write standard SFF data." << std::endl;
} // void osffstream::help(std::ostream& os=std::cout)
/*----------------------------------------------------------------------*/
void osffstream::writefileheader()
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write file header to file");
if (Msrceset) { Msffos << Msrce; }
if (Mfreeset) { Msffos << Mfree; }
} // void osffstream::writefileheader()
/*----------------------------------------------------------------------*/
void osffstream::writetrace(const Tdseries& series)
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write series of type double to file");
Msffos << series.copyout();
Msffos << Mwid2;
if (Minfoset) { Msffos << Minfo; }
if (Mfreeset) { Msffos << Mfree; }
} // void osffstream::writetrace(const Tdseries& series)
/*----------------------------------------------------------------------*/
void osffstream::writetrace(const Tfseries& series)
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write series of type float to file");
Msffos << series.copyout();
Msffos << Mwid2;
if (Minfoset) { Msffos << Minfo; }
if (Mfreeset) { Msffos << Mfree; }
} // void osffstream::writetrace(const Tfseries& series)
/*----------------------------------------------------------------------*/
void osffstream::writetrace(const Tiseries& series)
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write series of type integer to file");
Msffos << series.copyout();
Msffos << Mwid2;
if (Minfoset) { Msffos << Minfo; }
if (Mfreeset) { Msffos << Mfree; }
} // void osffstream::writetrace(const Tiseries& series)
} // namespace datwrite
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: util.h,v 1.4 2010-02-20 11:05:43 tforb Exp $
* $Id: util.h,v 1.5 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2010
*
......@@ -40,7 +40,7 @@
#define DATWRITE_UTIL_H_VERSION \
"TF_UTIL_H V1.0 "
#define DATWRITE_UTIL_H_CVSID \
"$Id: util.h,v 1.4 2010-02-20 11:05:43 tforb Exp $"
"$Id: util.h,v 1.5 2010-02-20 22:05:29 tforb Exp $"
namespace datwrite {
......@@ -73,7 +73,7 @@ namespace datwrite {
* \param N name of function
* \param M message to print
*/
#define TFXX_debug(C,N,M) \
#define DATWRITE_debug(C,N,M) \
if (C) { \
std::cerr << "DEBUG (" << N << ", " \
<< __FILE__ << " line #" << __LINE__ << "):" << std::endl \
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: writeany.cc,v 1.3 2010-02-18 12:16:48 tforb Exp $
* $Id: writeany.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2010
*
......@@ -36,9 +36,11 @@
#define DATWRITE_WRITEANY_CC_VERSION \
"TF_WRITEANY_CC V1.0 "
#define DATWRITE_WRITEANY_CC_CVSID \
"$Id: writeany.cc,v 1.3 2010-02-18 12:16:48 tforb Exp $"
"$Id: writeany.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $"
#include <datwritexx/writeany.h>
#include <datwritexx/error.h>
#include <datwritexx/sff.h>
namespace datwrite {
......@@ -49,7 +51,7 @@ namespace datwrite {
if (Mformat==Fsff) { Mos=new osffstream(os); }
else if (Mformat==Fgse) { Mos=new ogsestream(os); }
else
{ DATREAD_abort("ERROR (ianystream): unknown format!"); }
{ DATWRITE_abort("ERROR (ianystream): unknown format!"); }
}
/*----------------------------------------------------------------------*/
......@@ -69,7 +71,7 @@ namespace datwrite {
{ retval=Fsff; }
else if (id=="gse")
{ retval=Fgse; }
else { DATREAD_abort("unknown data type identifier!"); }
else { DATWRITE_abort("unknown data type identifier!"); }
return(retval);
}
// Eformat anyID(const std::string& identifier)
......@@ -80,7 +82,7 @@ namespace datwrite {
switch(id) {
case Fsff: retval="sff"; break;
case Fgse: retval="gse"; break;
default: DATREAD_abort("unknown data type ID#!");
default: DATWRITE_abort("unknown data type ID#!");
}
return(retval);
}
......@@ -93,7 +95,7 @@ namespace datwrite {
os << "data formats supported by oanystream:" << std::endl;
os << " sff: Stuttgart File Format" << std::endl;
os << " gse: raw GSE format" << std::endl;
os << DATREAD_READANY_CC_CVSID << std::endl;
os << DATWRITE_WRITEANY_CC_CVSID << std::endl;
}
/*----------------------------------------------------------------------*/
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: writeany.h,v 1.3 2010-02-18 12:16:48 tforb Exp $
* $Id: writeany.h,v 1.4 2010-02-20 22:05:29 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2010
*
......@@ -40,14 +40,16 @@
#define DATWRITE_WRITEANY_H_VERSION \
"DATWRITE_WRITEANY_H V1.0 "
#define DATWRITE_WRITEANY_H_CVSID \
"$Id: writeany.h,v 1.3 2010-02-18 12:16:48 tforb Exp $"
"$Id: writeany.h,v 1.4 2010-02-20 22:05:29 tforb Exp $"
#include<datwritexx/datwrite.h>
namespace datwrite {
enum Eformat {
Fsff, //<! SFF data
Fgse, //<! raw GSE data
Fascii //<! formatted ASCII data (TF format)
Fascii, //<! formatted ASCII data (TF format)
Fbin //<! pure binary data (TF format)
}; // enum Eformat
......
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