TF++, Miscellaneous classes and modules in C++:

◆ operator>>() [4/5]

template<class T , int N>
tfxx::fortranio::FortranBinInput& tfxx::fortranio::operator>> ( tfxx::fortranio::FortranBinInput fi,
blitz::Array< T, N > &  a 
)

Input operator template for class FortranBinInput and blitz.

The compiler will consider namespace tfxx::fortranio due to the involved FortranBinInput object.

Todo:
still far from finished

Definition at line 149 of file blitzfortranio.h.

References tfxx::fortranio::FortranBinInput::get(), tfxx::fortranio::FortranBinInput::match_magic(), and TFXX_assert.

151 {
153  "ERROR (blitz array operator>>): input has no matching magic number!");
154  int n;
155  fi.get(n);
156  TFXX_assert((N==n), "ERROR (blitz array operator>>): illegal rank!");
157  blitz::TinyVector<int, N> lbound, extent;
158  for (int i=0; i<N; i++) fi.get(lbound[i]);
159  for (int i=0; i<N; i++) fi.get(extent[i]);
160  blitz::Array<T, N> result(lbound, extent, blitz::fortranArray);
161  for (blitz::Array<T, N>::iterator i=result.begin(); i!=result.end(); ++i)
162  { fi.get(*i); }
163  a.reference(result);
164  return(fi);
165 }
#define TFXX_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:175
int magic(const char *const cmagic)
Create a magic number from a character string. ,If represents the input character sequence cmagic an...
Definition: ioswap.cc:59
bool match_magic(const char *cmagic)
expect magic number and adjust swapping flag
Definition: fortranio.cc:137
Here is the call graph for this function: