TSIO++ Time series input/output
sfftimeseries.h
Go to the documentation of this file.
1 
40 // include guard
41 #ifndef TSIO_SFFTIMESERIES_H_VERSION
42 
43 #define TSIO_SFFTIMESERIES_H_VERSION \
44  "TF_SFFTIMESERIES_H 2019/04/02"
45 
46 #include<tsxx/tsxx.h>
47 #include<tsxx/dttimeseries.h>
48 #include<tsioxx/traceheader.h>
49 
50 namespace ts {
51 
52  namespace sff {
53 
54  /*----------------------------------------------------------------------*/
55 
70  template<class C>
71  class SFFTimeSeries:
72  public ts::TimeSeries<C,ts::sff::TraceHeader> {
73  public:
80  typedef ts::TimeSeries<C,ts::sff::TraceHeader> Tbase;
81  typedef typename Tbase::Tvalue Tvalue;
82  typedef ts::TimeSeries<C,::sff::WID2> Twid2timeseries;
83  typedef ts::TimeSeries<C,ts::DTHeader<Tvalue> > Tdttimeseries;
84  typedef typename Tbase::Tseries Tseries;
85  typedef typename Tbase::Theader Theader;
86  typedef typename Tbase::Ttimeseries Ttimeseries;
87  typedef typename Tbase::Tconsttimeseries Tconsttimeseries;
89 
98  SFFTimeSeries(const int& i=-1): Tbase(), Mtraceindex(-1) { }
100  SFFTimeSeries(const Tseries& s, const Theader& h, const int& i=-1):
101  Tbase(s, h), Mtraceindex(i) { }
102  SFFTimeSeries(const Tbase& s, const int& i=-1):
103  Tbase(s), Mtraceindex(i) { }
105  Tbase(s), Mtraceindex(s.Mtraceindex) { }
107 
114  operator Twid2timeseries() const
116  { return Twid2timeseries(Tseries(*this), this->header.wid2()); }
118  operator Tdttimeseries() const
119  { return Tdttimeseries(Tseries(*this), this->header.wid2().dt); }
122  { this->Tseries::operator=(s); return(*this); }
124 
126  void read(std::istream& is, const bool& verbose=false);
128  int traceindex() const { return Mtraceindex; }
130  void settraceindex(int ti) { Mtraceindex=ti; }
131  private:
133  }; // class SFFTimeSeries
134 
135  /*----------------------------------------------------------------------*/
136 
141  } // namespace sff
142 } // namespace ts
143 
144 #endif // TSIO_SFFTIMESERIES_H_VERSION (includeguard)
145 
146 /* ----- END OF sfftimeseries.h ----- */
Tbase::Tvalue Tvalue
Definition: sfftimeseries.h:81
Tbase::Tconsttimeseries Tconsttimeseries
Definition: sfftimeseries.h:87
Tbase::Tseries Tseries
Definition: sfftimeseries.h:84
int Mtraceindex
trace index in data file
Tbase::Theader Theader
Definition: sfftimeseries.h:85
void read(std::istream &is, const bool &verbose=false)
read data from input stream
SFFTimeSeries(const Tbase &s, const int &i=-1)
default constructor
int traceindex() const
return trace index member data
ts::TimeSeries< C, ts::DTHeader< Tvalue > > Tdttimeseries
Definition: sfftimeseries.h:83
SFFTimeSeries(const int &i=-1)
default constructor
Definition: sfftimeseries.h:99
SFFTimeSeries(const SFFTimeSeries &s)
default constructor
hold a full SFF trace and provide conversion
Definition: sfftimeseries.h:71
SFFTimeSeries(const Tseries &s, const Theader &h, const int &i=-1)
default constructor
Tbase::Ttimeseries Ttimeseries
Definition: sfftimeseries.h:86
Outer namespace.
Definition: cmdlinefiles.cc:46
define ts::sff::TraceHeader (prototypes)
void settraceindex(int ti)
set trace index member data
ts::TimeSeries< C,::sff::WID2 > Twid2timeseries
Definition: sfftimeseries.h:82
SFFTimeSeries & operator=(const Tseries &s)
Take contents of base class.
ts::TimeSeries< C, ts::sff::TraceHeader > Tbase
Definition: sfftimeseries.h:80