Commit 41b90b42 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: 2984
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 8bfca27d
/*! \file reservoir.cc
* \brief series reservoir (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id: reservoir.cc,v 1.1 2010-02-20 22:33:32 tforb Exp $
* \author Thomas Forbriger
* \date 20/02/2010
*
* series reservoir (implementation)
*
* Copyright (c) 2010 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
* - 20/02/2010 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define DATWRITE_RESERVOIR_CC_VERSION \
"TF_RESERVOIR_CC V1.0 "
#define DATWRITE_RESERVOIR_CC_CVSID \
"$Id: reservoir.cc,v 1.1 2010-02-20 22:33:32 tforb Exp $"
#include <datwritexx/reservoir.h>
#include <datwritexx/error.h>
namespace datwrite {
namespace util {
seriesreservoir::seriesreservoir(const Tdseries& series)
{
Mvaluetype=Fdouble;
Mdseries=series.copyout();
} // seriesreservoir::seriesreservoir(const Tdseries& series)
seriesreservoir::seriesreservoir(const Tfseries& series)
{
Mvaluetype=Ffloat;
Mfseries=series.copyout();
} // seriesreservoir::seriesreservoir(const Tfseries& series)
seriesreservoir::seriesreservoir(const Tiseries& series)
{
Mvaluetype=Finteger;
Miseries=series.copyout();
} // seriesreservoir::seriesreservoir(const Tiseries& series)
Tdseries seriesreservoir::dseries() const
{
DATWRITE_assert((Mvaluetype == Fdouble), "wrong data type");
return Mdseries;
} // Tdseries seriesreservoir::dseries() const
Tfseries seriesreservoir::fseries() const
{
DATWRITE_assert((Mvaluetype == Ffloat), "wrong data type");
return Mfseries;
} // Tfseries seriesreservoir::fseries() const
Tiseries seriesreservoir::iseries() const
{
DATWRITE_assert((Mvaluetype == Finteger), "wrong data type");
return Miseries;
} // Tiseries seriesreservoir::iseries() const
} // namespace util
} // namespace datwrite
/* ----- END OF reservoir.cc ----- */
/*! \file reservoir.h
* \brief series reservoir (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: reservoir.h,v 1.1 2010-02-20 22:33:32 tforb Exp $
* \author Thomas Forbriger
* \date 20/02/2010
*
* series reservoir (prototypes)
*
* Copyright (c) 2010 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
* - 20/02/2010 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef DATWRITE_RESERVOIR_H_VERSION
#define DATWRITE_RESERVOIR_H_VERSION \
"TF_RESERVOIR_H V1.0 "
#define DATWRITE_RESERVOIR_H_CVSID \
"$Id: reservoir.h,v 1.1 2010-02-20 22:33:32 tforb Exp $"
#include<datwritexx/datwrite.h>
namespace datwrite {
namespace util {
/*! a flag to distingtuish the three types of sample data
*
*/
enum Evaluetype {
Fdouble, //! double precision floating point
Ffloat, //! single precision floating point
Finteger //! integer
}; // enum Evaluetype
/*----------------------------------------------------------------------*/
/*! class to store series data intermediately.
*
* Since SFF data requires a flag to be set which indicates whether another
* trace will follow the current trace or whether the current trace is the
* last one in the data file, the actual writing process has to be
* postponed until the next trace is submitted or until the file is going
* to be closed.
* This class is a small utility that helps to save an intermediate copy
* of the data until it is actually written.
*/
class seriesreservoir {
public:
seriesreservoir(const Tdseries& series);
seriesreservoir(const Tfseries& series);
seriesreservoir(const Tiseries& series);
Evaluetype valuetype() const { return Mvaluetype; }
Tdseries dseries() const;
Tfseries fseries() const;
Tiseries iseries() const;
private:
Tdseries Mdseries;
Tfseries Mfseries;
Tiseries Miseries;
Evaluetype Mvaluetype;
}; // class seriesreservoir
} // namespace util
} // namespace datwrite
#endif // DATWRITE_RESERVOIR_H_VERSION (includeguard)
/* ----- END OF reservoir.h ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.h,v 1.4 2010-02-20 22:05:29 tforb Exp $
* $Id: sff.h,v 1.5 2010-02-20 22:33:32 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -40,9 +40,10 @@
#define DATWRITE_SFF_H_VERSION \
"TF_SFF_H V1.0 "
#define DATWRITE_SFF_H_CVSID \
"$Id: sff.h,v 1.4 2010-02-20 22:05:29 tforb Exp $"
"$Id: sff.h,v 1.5 2010-02-20 22:33:32 tforb Exp $"
#include<datwritexx/datwrite.h>
#include<datwritexx/reservoir.h>
#include<sffxx.h>
#include<sffostream.h>
......@@ -69,8 +70,12 @@ namespace datwrite {
virtual void writetrace(const Tfseries& series);
virtual void writetrace(const Tiseries& series);
private:
sff::SFFostream Msffos;
bool Mdebug;
sff::WID2 Mwid2waiting;
sff::FREE Mfreewaiting;
sff::INFO Minfowaiting;
datwrite::util::seriesreservoir Mserieswaiting;
bool Mwid2iswaiting, Mfreeiswaiting, Minfoiswaiting;
}; // class osffstream
/*----------------------------------------------------------------------*/
......
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