QDP++
QDP::TextFileWriter Class Reference

Text output class. More...

#include <qdp_io.h>

Inheritance diagram for QDP::TextFileWriter:
QDP::TextWriter

Public Member Functions

 TextFileWriter ()
 ~TextFileWriter ()
 TextFileWriter (const std::string &p)
bool is_open ()
 Queries whether the file is open.
void open (const std::string &p)
void close ()
 Closes the last file opened.
void flush ()
 Flushes the buffer.
Public Member Functions inherited from QDP::TextWriter
 TextWriter ()
virtual ~TextWriter ()
virtual bool fail ()
 Checks status of the previous IO operation.
virtual void write (const std::string &output)
virtual void write (const char *output)
virtual void write (const char &output)
virtual void write (const int &output)
virtual void write (const unsigned int &output)
virtual void write (const short int &output)
virtual void write (const unsigned short int &output)
virtual void write (const long int &output)
virtual void write (const unsigned long int &output)
virtual void write (const long long int &output)
virtual void write (const float &output)
virtual void write (const double &output)
virtual void write (const bool &output)

Protected Member Functions

std::ostream & getOstream ()
 Get the internal output stream.
Protected Member Functions inherited from QDP::TextWriter
template<typename T>
void writePrimitive (const T &output)
 The universal data-writer.

Detailed Description

Text output class.

This class is used to write data to a text file. Output is done from the primary node only..

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

Definition at line 318 of file qdp_io.h.

Constructor & Destructor Documentation

◆ TextFileWriter() [1/2]

QDP::TextFileWriter::TextFileWriter ( )

Definition at line 470 of file qdp_io.cc.

◆ ~TextFileWriter()

QDP::TextFileWriter::~TextFileWriter ( )

Closes the last file opened

Definition at line 518 of file qdp_io.cc.

References close().

◆ TextFileWriter() [2/2]

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

Opens a file for writing.

Parameters
pThe name of the file

Definition at line 472 of file qdp_io.cc.

References open().

Member Function Documentation

◆ close()

void QDP::TextFileWriter::close ( )

Closes the last file opened.

Definition at line 483 of file qdp_io.cc.

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

Referenced by ~TextFileWriter().

◆ flush()

void QDP::TextFileWriter::flush ( )
virtual

Flushes the buffer.

Implements QDP::TextWriter.

Definition at line 508 of file qdp_io.cc.

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

◆ getOstream()

std::ostream & QDP::TextFileWriter::getOstream ( )
inlineprotectedvirtual

Get the internal output stream.

Implements QDP::TextWriter.

Definition at line 354 of file qdp_io.h.

◆ is_open()

bool QDP::TextFileWriter::is_open ( )

Queries whether the file is open.

Returns
true if the file is open; false otherwise.

Definition at line 493 of file qdp_io.cc.

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

Referenced by close(), flush(), and open().

◆ open()

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

Opens a file for writing.

Parameters
pThe name of the file

Definition at line 474 of file qdp_io.cc.

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

Referenced by TextFileWriter().


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