DATRW++ library: seismic data I/O with multiple formats
seife.h
Go to the documentation of this file.
1 /*! \file seife.h
2  * \brief seife reading and writing module (prototypes)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 30/11/2010
8  *
9  * seife reading and writing module (prototypes)
10  *
11  * Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach)
12  *
13  * ----
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27  * ----
28  *
29  * REVISIONS and CHANGES
30  * - 30/11/2010 V1.0 Thomas Forbriger
31  * - 18/11/2016 V1.1 use debug flag in base class
32  *
33  * ============================================================================
34  */
35 
36 // include guard
37 #ifndef DATRW_SEIFE_H_VERSION
38 
39 #define DATRW_SEIFE_H_VERSION \
40  "DATRW_SEIFE_H V1.1"
41 
42 #include<datrwxx/datread.h>
43 #include<datrwxx/datwrite.h>
44 
45 namespace datrw {
46 
47  /*! \brief internals of the seife I/O module
48  *
49  * \ingroup group_seife
50  */
51  namespace seife {
52 
53  extern const bool isbinary;
54  extern const char* const streamID;
55 
56  } // namespace seife
57 
58  /*----------------------------------------------------------------------*/
59 
60  /*! \brief class to read seife data
61  *
62  * \ingroup group_seife
63  */
64  class iseifestream: public idatstream {
65  public:
66  typedef idatstream Tbase;
67  iseifestream(std::istream& is,
68  const std::string& modifier="",
69  const bool& debug=false);
70  virtual ~iseifestream() { }
71  virtual Tdseries dseries();
72  virtual Tfseries fseries();
73  // virtual Tiseries iseries();
74  virtual void skipseries();
75  static void help(std::ostream& os=std::cout);
76  static const std::ios_base::openmode openmode;
77  private:
78  void settraceheader();
79  std::string Mmodifier; //!< format modifier
80  }; // class iseifestream
81 
82  /*----------------------------------------------------------------------*/
83 
84  /*! \brief class to write seife data
85  *
86  * \ingroup group_seife
87  */
88  class oseifestream: public odatstream {
89  public:
90  typedef odatstream Tbase;
91  oseifestream(std::ostream& os,
92  const std::string& modifier="",
93  const bool& debug=false);
94  inline virtual ~oseifestream() { }
95  static void help(std::ostream& os=std::cout);
96  static const std::ios_base::openmode openmode;
97  protected:
98  virtual void writefileheader();
99  virtual void writetrace(const Tdseries::Tcoc& series);
100  virtual void writetrace(const Tfseries::Tcoc& series);
101  private:
102  void writetraceheader(const unsigned int& n);
103  bool Mtracewritten; //!< true, if a trace has be written
104  std::string Mmodifier; //!< format modifier
105  }; // class oseifestream
106 
107 } // namespace datrw
108 
109 #endif // DATRW_SEIFE_H_VERSION (includeguard)
110 
111 /* ----- END OF seife.h ----- */
static void help(std::ostream &os=std::cout)
class to read seife data
Definition: seife.h:64
static const std::ios_base::openmode openmode
Definition: seife.h:96
aff::Series< float > Tfseries
Definition: types.h:46
idatstream Tbase
Definition: seife.h:66
virtual void skipseries()
virtual ~iseifestream()
Definition: seife.h:70
std::string Mmodifier
format modifier
Definition: seife.h:79
aff::Series< double > Tdseries
Definition: types.h:45
bool Mtracewritten
true, if a trace has be written
Definition: seife.h:103
std::string Mmodifier
format modifier
Definition: seife.h:104
static const std::ios_base::openmode openmode
Definition: seife.h:76
bool debug()
indicate debug mode
Definition: datwrite.h:145
virtual ~oseifestream()
Definition: seife.h:94
bool debug()
indicate debug mode
Definition: datread.h:116
Root namespace of library.
Definition: aalibdatrwxx.cc:16
const char *const streamID
Format properties.
Definition: seifeformat.cc:53
odatstream Tbase
Definition: seife.h:90
virtual void writetrace(const Tdseries::Tcoc &series)
write double data
Definition: oseifestream.cc:74
virtual void writefileheader()
actually write the file header
Definition: oseifestream.cc:65
oseifestream(std::ostream &os, const std::string &modifier="", const bool &debug=false)
Definition: oseifestream.cc:52
void writetraceheader(const unsigned int &n)
Definition: oseifestream.cc:95
class to write seife data
Definition: seife.h:88
virtual Tdseries dseries()
Definition: iseifestream.cc:87
const bool isbinary
Format properties.
Definition: seifeformat.cc:52
static void help(std::ostream &os=std::cout)
iseifestream(std::istream &is, const std::string &modifier="", const bool &debug=false)
Definition: iseifestream.cc:50
generic interface definition (prototypes)
virtual Tfseries fseries()
Definition: iseifestream.cc:98