QDP++
QDP::TextFileReader Class Reference

Text file input class. More...

#include <qdp_io.h>

Inheritance diagram for QDP::TextFileReader:
QDP::TextReader

Public Member Functions

 TextFileReader ()
 ~TextFileReader ()
 TextFileReader (const std::string &p)
void open (const std::string &p)
 Opens a file for reading.
void close ()
 Closes the last file opened.
bool is_open ()
 Queries whether the file is open.
Public Member Functions inherited from QDP::TextReader
 TextReader ()
virtual ~TextReader ()
virtual bool fail ()
 Checks status of the previous IO operation.
virtual void read (std::string &result)
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)

Protected Member Functions

std::istream & getIstream ()
 Get the internal input stream.
Protected Member Functions inherited from QDP::TextReader
template<typename T>
void readPrimitive (T &output)
 The universal data-reader.

Detailed Description

Text file input class.

This class is used to read data from a text file. Input is done on the primary node and all nodes end up with the same data.

The read methods are also wrapped by externally defined >> operators,

Definition at line 154 of file qdp_io.h.

Constructor & Destructor Documentation

◆ TextFileReader() [1/2]

QDP::TextFileReader::TextFileReader ( )

Definition at line 224 of file qdp_io.cc.

◆ ~TextFileReader()

QDP::TextFileReader::~TextFileReader ( )

Closes the last file opened

Definition at line 263 of file qdp_io.cc.

References close().

◆ TextFileReader() [2/2]

QDP::TextFileReader::TextFileReader ( const std::string & p)
explicit

Opens a file for reading.

Parameters
pThe name of the file

Definition at line 226 of file qdp_io.cc.

References open().

Member Function Documentation

◆ close()

void QDP::TextFileReader::close ( )

Closes the last file opened.

Definition at line 237 of file qdp_io.cc.

References is_open(), and QDP::Layout::primaryNode().

Referenced by ~TextFileReader().

◆ getIstream()

std::istream & QDP::TextFileReader::getIstream ( )
inlineprotectedvirtual

Get the internal input stream.

Implements QDP::TextReader.

Definition at line 187 of file qdp_io.h.

◆ is_open()

bool QDP::TextFileReader::is_open ( )

Queries whether the file is open.

Returns
true if the file is open; false otherwise.

Definition at line 247 of file qdp_io.cc.

References QDP::QDPInternal::broadcast(), QDP::Layout::primaryNode(), and QDP::QDP_isInitialized().

Referenced by close(), and open().

◆ open()

void QDP::TextFileReader::open ( const std::string & p)

Opens a file for reading.

Parameters
pThe name of the file

Definition at line 228 of file qdp_io.cc.

References is_open(), QDP::Layout::primaryNode(), and QDP::QDP_error_exit().

Referenced by TextFileReader().


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