/*! \file sff.h * \brief wrapper around SFF output stream (prototypes) * * ---------------------------------------------------------------------------- * * $Id: sff.h,v 1.11 2010-04-30 19:59:35 tforb Exp $ * \author Thomas Forbriger * \date 11/04/2006 * * wrapper around SFF output stream (prototypes) * * Copyright (c) 2006 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 * - 11/04/2006 V1.0 Thomas Forbriger * * ============================================================================ */ // include guard #ifndef DATWRITE_SFF_H_VERSION #define DATWRITE_SFF_H_VERSION \ "TF_SFF_H V1.0 " #define DATWRITE_SFF_H_CVSID \ "$Id: sff.h,v 1.11 2010-04-30 19:59:35 tforb Exp $" #include #include #include namespace datwrite { /*! \brief SFF writing interface * * \defgroup sff Write SFF and GSE data */ /*! \brief class to write SFF data * * \ingroup sff */ class osffstream: public odatstream { public: typedef odatstream Tbase; osffstream(std::ostream& os, const bool& debug=false); inline virtual ~osffstream() { this->flushwaitingtrace(true); } 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: /*! flush waiting trace data * \PARAM last true if no other trace will be written, * i.e. only set to true when called from destructor */ void flushwaitingtrace(const bool& last=false); protected: bool Mdebug; private: bool Mwid2iswaiting, Mfreeiswaiting, Minfoiswaiting; sff::WID2 Mwid2waiting; sff::FREE Mfreewaiting; sff::INFO Minfowaiting; datwrite::util::seriesreservoir Mserieswaiting; protected: ::sff::Enormmode Mnormmode; }; // class osffstream /*----------------------------------------------------------------------*/ /*! \brief class to write GSE data * * \ingroup sff */ class ogsestream: public osffstream { public: typedef osffstream Tbase; ogsestream(std::ostream& os, const bool& debug=false); inline virtual ~ogsestream() { } static void help(std::ostream& os=std::cout); /* protected: virtual void writetrace(const Tdseries& series) { DATWRITE_abort("ogsestream cannot write doubles"); } virtual void writetrace(const Tfseries& series) { DATWRITE_abort("ogsestream cannot write floats"); } */ }; // class ogsestream } // namespace datwrite #endif // DATWRITE_SFF_H_VERSION (includeguard) /* ----- END OF sff.h ----- */