DATRW++ library: seismic data I/O with multiple formats

◆ convert() [1/3]

template<class Cin , class Cout >
Cout datrw::util::convert ( const typename Cin::Tcoc &  data)

function template to convert a whole series

Parameters
Cinseries container type of the input series like datrw::Tdseries
Coutseries container type of the output series like datrw::Tfseries
dataactual input series container
Returns
series container with converted data

Definition at line 74 of file util.h.

References datrw::mseed::key::data, and datrw::hpmo::nsamples.

Referenced by datrw::binary::anonymous_namespace{ibinarystream.cc}::readany(), and datrw::ascii::anonymous_namespace{iasciistream.cc}::readany().

75  {
76  int nsamples=data.size();
77  Cout retval(nsamples);
78  typedef typename Cin::Tvalue Tinvalue;
79  typedef typename Cout::Tvalue Toutvalue;
80  aff::Iterator<Cout> IO(retval);
81  aff::Browser<Cin> BI(data);
82  ::datrw::report_conversion<Tinvalue, Toutvalue>(std::cout);
83  while (IO.valid() && BI.valid())
84  {
85  Tinvalue sample=*BI;
86  *IO=static_cast<Toutvalue>(sample);
87  ++IO;
88  ++BI;
89  }
90  return(retval);
91  } // template function convert
const int nsamples
number of samples per minute block and channel
Definition: hpmodata.h:51
const char *const data
keywords for consistency checks
int Tvalue
Definition: pdasread.h:75
Here is the caller graph for this function: