DATRW++ library: seismic data I/O with multiple formats
reservoir.h
Go to the documentation of this file.
1 /*! \file reservoir.h
2  * \brief series reservoir (prototypes)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 20/02/2010
8  *
9  * series reservoir (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  * - 20/02/2010 V1.0 Thomas Forbriger
31  * - 07/06/2011 V1.1 promise constness of series samples
32  *
33  * ============================================================================
34  */
35 
36 // include guard
37 #ifndef DATRW_RESERVOIR_H_VERSION
38 
39 #define DATRW_RESERVOIR_H_VERSION \
40  "DATRW_RESERVOIR_H V1.1"
41 
42 #include<datrwxx/datwrite.h>
43 
44 namespace datrw {
45 
46  namespace util {
47 
48  /*! a flag to distingtuish the three types of sample data
49  *
50  */
51  enum Evaluetype {
52  Fnone, //! empty reservoir
53  Fdouble, //! double precision floating point
54  Ffloat, //! single precision floating point
55  Finteger //! integer
56  }; // enum Evaluetype
57 
58  /*----------------------------------------------------------------------*/
59 
60  /*! class to store series data intermediately.
61  *
62  * Since SFF data requires a flag to be set which indicates whether another
63  * trace will follow the current trace or whether the current trace is the
64  * last one in the data file, the actual writing process has to be
65  * postponed until the next trace is submitted or until the file is going
66  * to be closed.
67  * This class is a small utility that helps to save an intermediate copy
68  * of the data until it is actually written.
69  */
71  public:
73  seriesreservoir(const Tdseries::Tcoc& series);
74  seriesreservoir(const Tfseries::Tcoc& series);
75  seriesreservoir(const Tiseries::Tcoc& series);
76  Evaluetype valuetype() const { return Mvaluetype; }
77  Tdseries::Tcoc dseries() const;
78  Tfseries::Tcoc fseries() const;
79  Tiseries::Tcoc iseries() const;
80  private:
82  Tdseries::Tcoc Mdseries;
83  Tfseries::Tcoc Mfseries;
84  Tiseries::Tcoc Miseries;
85  }; // class seriesreservoir
86 
87  } // namespace util
88 
89 } // namespace datrw
90 
91 #endif // DATRW_RESERVOIR_H_VERSION (includeguard)
92 
93 /* ----- END OF reservoir.h ----- */
Tfseries::Tcoc Mfseries
Definition: reservoir.h:83
Evaluetype valuetype() const
Definition: reservoir.h:76
Root namespace of library.
Definition: aalibdatrwxx.cc:16
single precision floating point
Definition: reservoir.h:55
Tdseries::Tcoc dseries() const
Definition: reservoir.cc:67
double precision floating point
Definition: reservoir.h:54
Tiseries::Tcoc Miseries
Definition: reservoir.h:84
Tiseries::Tcoc iseries() const
Definition: reservoir.cc:79
empty reservoir
Definition: reservoir.h:53
generic interface definition (prototypes)
Tdseries::Tcoc Mdseries
Definition: reservoir.h:82
Tfseries::Tcoc fseries() const
Definition: reservoir.cc:73