Fortran SFF API to data I/O streams in C++
fapid_sff_wtrace.cc
Go to the documentation of this file.
1 
33 #define TF_FAPID_SFF_WTRACE_CC_VERSION \
34  "TF_FAPID_SFF_WTRACE_CC V1.0 "
35 
36 #include <fapidxx/fapidsff.h>
37 #include <fapidxx/fileunit.h>
38 #include <fapidxx/helper.h>
39 #include <fapidxx/wid2container.h>
40 #include <fapidxx/error.h>
41 
42 using namespace fapidxx;
43 
78 int sff_wtrace__(integer *lu, char *wid2line, integer *nsamp, real *fdata,
79  integer *idata, logical *last, integer *ierr,
80  ftnlen wid2line_len)
81 {
82  int retval=0;
83  *ierr=0;
84  try {
85  datrw::oanystream &os=ostreammanager(static_cast<int>(*lu));
86  WID2container wid2c(wid2line, wid2line_len);
87  unsigned int nsamples=static_cast<unsigned int>(*nsamp);
88  os << wid2c.wid2;
89  aff::LinearShape shape(0, nsamples-1, 0);
90  datrw::Tfseries series(shape, aff::SharedHeap<real>(fdata, *nsamp));
91  os << series;
92  if (*last) ostreammanager.close(static_cast<int>(*lu));
93  }
94  catch (...) {
95  *ierr=1;
96  }
97  return(retval);
98 } // int sff_wtrace__
99 
100 /* ----- END OF fapid_sff_wtrace.cc ----- */
This is the interface usually expected by Fortran programs linking to libsff.a (prototypes) ...
Definition: error.cc:44
long int integer
Fortran integer type.
Definition: fapidsff.h:66
sff::WID2 wid2
WID2 data.
This struct is used to pass WID2 line data within libfapidxx.
Definition: wid2container.h:62
container for WID2 data (prototypes)
exceptions and error handling macros (prototypes)
float real
Fortran real type (single precision)
Definition: fapidsff.h:73
int sff_wtrace__(integer *lu, char *wid2line, integer *nsamp, real *fdata, integer *idata, logical *last, integer *ierr, ftnlen wid2line_len)
Write one trace of data with INFO line.
long int logical
Fortran logical type.
Definition: fapidsff.h:68
::fapidxx::OFileUnits ostreammanager
the global ostream manager
Definition: fileunit.cc:51
long int ftnlen
Fortran string size type.
Definition: fapidsff.h:70
a file unit interface to libdatrwxx (prototypes)
void close(const int &unit)
close the file associated with this file unit
Definition: fileunit.cc:162
some helper functions (prototypes)