|
QDP++
|
Binary input base class. More...
#include <qdp_io.h>
Public Types | |
| typedef std::istream::pos_type | pos_type |
| typedef std::istream::off_type | off_type |
Public Member Functions | |
| virtual | ~BinaryReader () |
| virtual void | readArrayPrimaryNode (char *output, size_t nbytes, size_t nmemb) |
| Read data on the primary node only. | |
| virtual void | readArray (char *output, size_t nbytes, size_t nmemb) |
| Read data on the primary node and broadcast to all nodes. | |
| virtual void | readArrayLittleEndian (char *output, size_t nbytes, size_t nmemb) |
| virtual void | readArrayPrimaryNodeLittleEndian (char *output, size_t nbytes, size_t nmemb) |
| virtual void | readDesc (std::string &result) |
| virtual void | read (std::string &result, size_t nbytes) |
| Read some max number of characters - 1 upto and excluding a newline. | |
| virtual void | read (char &result) |
| virtual void | read (int &result) |
| virtual void | read (unsigned int &result) |
| virtual void | read (short int &result) |
| virtual void | read (unsigned short int &result) |
| virtual void | read (long int &result) |
| virtual void | read (unsigned long int &result) |
| virtual void | read (long long int &result) |
| virtual void | read (float &result) |
| virtual void | read (double &result) |
| virtual void | read (bool &result) |
| virtual bool | fail () |
| Checks status of the previous IO operation. | |
| virtual QDPUtil::n_uint32_t | getChecksum () |
| Get the current checksum. | |
| virtual void | resetChecksum () |
| Reset the current checksum. | |
| virtual pos_type | currentPosition () |
| Current position. | |
| virtual void | seek (pos_type off) |
| Set the current position. | |
| virtual void | seekBegin (off_type off) |
| Set the position relative from the start. | |
| virtual void | seekRelative (off_type off) |
| Set the position relative to the current position. | |
| virtual void | seekEnd (off_type off) |
| Set the position relative from the end. | |
| virtual void | rewind () |
| Rewind object to the beginning. | |
Protected Member Functions | |
| template<typename T> | |
| void | readPrimitive (T &output) |
| The universal data-reader. | |
| virtual QDPUtil::n_uint32_t & | internalChecksum ()=0 |
| Get the current checksum to modify. | |
| virtual std::istream & | getIstream ()=0 |
| Get the internal input stream. | |
Binary input base class.
This class is used to read data from a binary object. The data in the file is assumed to be big-endian. If the host nachine is little-endian, the data is byte-swapped. All nodes end up with the same data
The read methods are also wrapped by externally defined functions and >> operators,
| typedef std::istream::off_type QDP::BinaryReader::off_type |
| typedef std::istream::pos_type QDP::BinaryReader::pos_type |
|
inlinevirtual |
|
virtual |
Current position.
Reimplemented in QDP::BinaryReaderWriter.
Definition at line 553 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), getIstream(), and QDP::Layout::primaryNode().
|
virtual |
Checks status of the previous IO operation.
Reimplemented in QDP::BinaryReaderWriter.
Definition at line 524 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), getIstream(), and QDP::Layout::primaryNode().
Referenced by QDP::readArchiv().
|
virtual |
Get the current checksum.
Reimplemented in QDP::BinaryReaderWriter.
Definition at line 536 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), and internalChecksum().
|
protectedpure virtual |
Get the internal input stream.
Implemented in QDP::BinaryBufferReader, QDP::BinaryBufferReaderWriter, QDP::BinaryFileReader, QDP::BinaryFileReaderWriter, and QDP::BinaryReaderWriter.
Referenced by currentPosition(), fail(), read(), readArrayLittleEndian(), readArrayPrimaryNode(), readArrayPrimaryNodeLittleEndian(), rewind(), seek(), seekBegin(), seekEnd(), and seekRelative().
|
protectedpure virtual |
Get the current checksum to modify.
Implemented in QDP::BinaryBufferReader, QDP::BinaryBufferReaderWriter, QDP::BinaryFileReader, QDP::BinaryFileReaderWriter, and QDP::BinaryReaderWriter.
Referenced by getChecksum(), read(), readArrayPrimaryNode(), resetChecksum(), rewind(), seek(), seekBegin(), seekEnd(), and seekRelative().
|
virtual |
Definition at line 695 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 655 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 691 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 687 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 659 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 675 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 683 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 667 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Read some max number of characters - 1 upto and excluding a newline.
This is the getline function for the underlying stream
Definition at line 630 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), QDPUtil::crc32(), getIstream(), internalChecksum(), QDP::Layout::primaryNode(), and QDP::QDP_error_exit().
Referenced by QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), and QDP::readArchivHeader().
|
virtual |
Definition at line 663 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 679 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Definition at line 671 of file qdp_io.cc.
References readPrimitive().
|
virtual |
Read data on the primary node and broadcast to all nodes.
| output | The location to which data is read |
| nbytes | The size in bytes of each datum |
| The | number of data. |
Definition at line 706 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), and readArrayPrimaryNode().
Referenced by QDP::read(), QDP::readArchiv(), and readPrimitive().
|
virtual |
Read data on the primary node and broadcast to all nodes. Assumes data is little endian and no checksums are done.
| output | The location to which data is read |
| nbytes | The size in bytes of each datum |
| The | number of data. |
Definition at line 734 of file qdp_io.cc.
References QDPUtil::big_endian(), QDP::QDPInternal::broadcast(), QDPUtil::byte_swap(), getIstream(), and QDP::Layout::primaryNode().
|
virtual |
Read data on the primary node only.
| output | The location to which data is read |
| nbytes | The size in bytes of each datum |
| The | number of data. |
Definition at line 715 of file qdp_io.cc.
References QDPUtil::big_endian(), QDPUtil::byte_swap(), QDPUtil::crc32(), getIstream(), internalChecksum(), and QDP::Layout::primaryNode().
Referenced by QDP::readArchiv(), readArray(), readDesc(), QDP::readOLattice(), QDP::readOLattice(), QDP::readOLattice(), and QDP::LatticeTimeSliceIO::readOLatticeSlice().
|
virtual |
Definition at line 754 of file qdp_io.cc.
References QDPUtil::big_endian(), QDPUtil::byte_swap(), getIstream(), and QDP::Layout::primaryNode().
|
virtual |
Definition at line 610 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), QDP::Layout::primaryNode(), and readArrayPrimaryNode().
Referenced by QDP::MapObjDiskEnv::getMetaData(), and QDP::readDesc().
|
protected |
|
virtual |
Reset the current checksum.
Reimplemented in QDP::BinaryReaderWriter.
Definition at line 547 of file qdp_io.cc.
References internalChecksum().
|
virtual |
Rewind object to the beginning.
Rewind.
The checksum is reset
Reimplemented in QDP::BinaryReaderWriter.
Definition at line 600 of file qdp_io.cc.
References getIstream(), internalChecksum(), and QDP::Layout::primaryNode().
|
virtual |
Set the current position.
The checksum is reset
Definition at line 564 of file qdp_io.cc.
References getIstream(), internalChecksum(), and QDP::Layout::primaryNode().
|
virtual |
Set the position relative from the start.
The checksum is reset
Definition at line 573 of file qdp_io.cc.
References getIstream(), internalChecksum(), and QDP::Layout::primaryNode().
|
virtual |
Set the position relative from the end.
The checksum is reset
Definition at line 591 of file qdp_io.cc.
References getIstream(), internalChecksum(), and QDP::Layout::primaryNode().
|
virtual |
Set the position relative to the current position.
The checksum is reset
Definition at line 582 of file qdp_io.cc.
References getIstream(), internalChecksum(), and QDP::Layout::primaryNode().