QDP++
QDP::QDPFileReader Class Reference

QIO class. More...

#include <qdp_qdpio.h>

Public Member Functions

 QDPFileReader ()
 Partial constructor.
 ~QDPFileReader ()
 Closes the last file opened.
 QDPFileReader (XMLReader &xml, const std::string &path, QDP_serialparallel_t qdp_serpar)
 Opens a file for reading.
void open (XMLReader &xml, const std::string &path, QDP_serialparallel_t qdp_serpar)
 Opens a file for reading.
void close ()
 Closes the last file opened.
bool is_open ()
 Queries whether a file is open.
void read (XMLReader &xml)
 Reads a record header only.
template<class T, class C>
void read (XMLReader &xml, QDPType< T, C > &s1)
 Read a QDP object.
template<class T>
void read (XMLReader &xml, OScalar< T > &s1)
 Reads an OScalar object.
template<class T>
void read (XMLReader &xml, OLattice< T > &s1)
 Reads an OLattice object.
template<class T>
void read (XMLReader &xml, multi1d< OScalar< T > > &s1)
 Reads an array of objects all in a single record.
template<class T>
void read (XMLReader &xml, multi1d< OLattice< T > > &s1)
 Reads an array of objects all in a single record.
void read (XMLReader &xml, BinaryBufferReader &s1)
 Reads an XMLReader plus BinaryBufferReader pair.
bool eof () const
 Query whether the end-of-file has been reached.
bool bad () const
 Query whether an unrecoverable error has occurred.
void clear (QDP_iostate_t state=QDPIO_goodbit)
 Sets a new value for the IO status, ignoring the existing value.

Protected Member Functions

QIO_Readerget () const

Detailed Description

QIO class.

This is a QDP object wrapper around the QIO library.

QIO is a C library independentof QDP. It is designed to read/write SCIDAC format data files, which means a mixture of binary data and XML metadata together in the same file according to a scheme called Lime. There is a seperate independent library for handling general Lime files.

The data is assumed to be a record in a Lime file. The user metadata (both file and record) is also read.

Data is assumed to be stored in the file in big-endian format and any necessary byte-swapping is taken care of.

The status of the IO operations is monitored internally and can be queried.

Definition at line 326 of file qdp_qdpio.h.

Constructor & Destructor Documentation

◆ QDPFileReader() [1/2]

QDP::QDPFileReader::QDPFileReader ( )

Partial constructor.

Definition at line 106 of file qdp_qdpio.cc.

◆ ~QDPFileReader()

QDP::QDPFileReader::~QDPFileReader ( )

Closes the last file opened.

Definition at line 204 of file qdp_qdpio.cc.

References close().

◆ QDPFileReader() [2/2]

QDP::QDPFileReader::QDPFileReader ( XMLReader & xml,
const std::string & path,
QDP_serialparallel_t qdp_serpar )

Opens a file for reading.

Also reads the file user metadata record.

Parameters
xmlContainer for the file metadata.
pathThe name of the file.
qdp_serparSerial or parallel IO.

Definition at line 108 of file qdp_qdpio.cc.

References open().

Member Function Documentation

◆ bad()

bool QDP::QDPFileReader::bad ( ) const

Query whether an unrecoverable error has occurred.

Returns
True if an error has occured; false otherwise

Definition at line 197 of file qdp_qdpio.cc.

◆ clear()

void QDP::QDPFileReader::clear ( QDP_iostate_t state = QDPIO_goodbit)

Sets a new value for the IO status, ignoring the existing value.

Parameters
stateThe new state (defaults to QDPIO_goodbit).

Definition at line 199 of file qdp_qdpio.cc.

Referenced by read(), read(), read(), read(), and read().

◆ close()

void QDP::QDPFileReader::close ( )

Closes the last file opened.

Definition at line 181 of file qdp_qdpio.cc.

References is_open(), and QDP::QDPIO_badbit.

Referenced by QDP::close(), and ~QDPFileReader().

◆ eof()

bool QDP::QDPFileReader::eof ( ) const

Query whether the end-of-file has been reached.

Returns
True if the end-of-file has been reached; false otherwise

Definition at line 195 of file qdp_qdpio.cc.

◆ get()

QIO_Reader * QDP::QDPFileReader::get ( ) const
inlineprotected

Definition at line 411 of file qdp_qdpio.h.

◆ is_open()

bool QDP::QDPFileReader::is_open ( )

Queries whether a file is open.

Returns
true if a file is open; false otherwise.

Definition at line 193 of file qdp_qdpio.cc.

Referenced by close(), and QDP::is_open().

◆ open()

◆ read() [1/3]

void QDP::QDPFileReader::read ( XMLReader & xml)

Reads a record header only.

Definition at line 221 of file qdp_qdpio.cc.

References QDP::QDPIO::cerr, QDP::XMLReader::open(), QDP::Layout::primaryNode(), and QDP::QDP_abort().

Referenced by read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), and QDP::read().

◆ read() [2/3]

void QDP::QDPFileReader::read ( XMLReader & rec_xml,
BinaryBufferReader & s1 )

◆ read() [3/3]

template<class T, class C>
void QDP::QDPFileReader::read ( XMLReader & xml,
QDPType< T, C > & s1 )
inline

Read a QDP object.

Definition at line 370 of file qdp_qdpio.h.

References read().


The documentation for this class was generated from the following files: