|
QDP++
|
Binary file input class. More...
#include <qdp_io.h>
Public Member Functions | |
| BinaryFileReader () | |
| ~BinaryFileReader () | |
| BinaryFileReader (const std::string &p) | |
| bool | is_open () |
| Queries whether the file is open. | |
| void | open (const std::string &p) |
| Opens a file for reading. | |
| void | close () |
| Closes the last file opened. | |
| Public Member Functions inherited from QDP::BinaryReader | |
| 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 | |
| QDPUtil::n_uint32_t & | internalChecksum () |
| Get the current checksum to modify. | |
| std::istream & | getIstream () |
| Get the internal input stream. | |
| Protected Member Functions inherited from QDP::BinaryReader | |
| template<typename T> | |
| void | readPrimitive (T &output) |
| The universal data-reader. | |
Additional Inherited Members | |
| Public Types inherited from QDP::BinaryReader | |
| typedef std::istream::pos_type | pos_type |
| typedef std::istream::off_type | off_type |
Binary file input class.
This class is used to read data from a binary file. The data in the file is assumed to be big-endian. If the host machine 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,
| QDP::BinaryFileReader::~BinaryFileReader | ( | ) |
|
explicit |
| void QDP::BinaryFileReader::close | ( | ) |
Closes the last file opened.
Definition at line 981 of file qdp_io.cc.
References is_open(), and QDP::Layout::primaryNode().
Referenced by QDP::MapObjDiskEnv::getMetaData(), QDP::readArchiv(), and ~BinaryFileReader().
|
inlineprotectedvirtual |
Get the internal input stream.
Implements QDP::BinaryReader.
|
inlineprotectedvirtual |
Get the current checksum to modify.
Implements QDP::BinaryReader.
| bool QDP::BinaryFileReader::is_open | ( | ) |
Queries whether the file is open.
Definition at line 991 of file qdp_io.cc.
References QDP::QDPInternal::broadcast(), QDP::Layout::primaryNode(), and QDP::QDP_isInitialized().
| void QDP::BinaryFileReader::open | ( | const std::string & | p | ) |
Opens a file for reading.
| p | The name of the file |
Definition at line 970 of file qdp_io.cc.
References is_open(), QDP::Layout::primaryNode(), and QDP::QDP_error_exit().
Referenced by BinaryFileReader(), and QDP::MapObjDiskEnv::getMetaData().