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

◆ get()

template<typename T >
void tfxx::fortranio::FortranBinInput::get ( T &  value)

extract a value (perform swapping if requested)

Pass by reference argument because overloading by return type is not possible.

Parameters
valuevalue of type T read from stream

Definition at line 261 of file fortranio.h.

References tfxx::ioswap::IOUnion< T >::bytes, extract_chars(), Mswap, tfxx::ioswap::swap(), and tfxx::ioswap::IOUnion< T >::value.

Referenced by tfxx::fortranio::operator>>().

262 {
264  extract_chars(buf.bytes, sizeof(T));
265  value=buf.value;
266  if (Mswap) { value=tfxx::ioswap::swap(buf.value); }
267 }
char bytes[sizeof(T)]
Definition: bytesex.h:100
T swap(const T &value)
How to swap any generic type.
Definition: bytesex.h:138
void extract_chars(char *buf, const int &n)
extract next set of characters
Definition: fortranio.cc:128
bool Mswap
Has byte swapping to be performed.
Definition: fortranio.h:171
Here is the call graph for this function:
Here is the caller graph for this function: