QDP++
QDP::BinaryBufferReaderWriter Class Reference

Binary buffer input/ouput class. More...

#include <qdp_io.h>

Inheritance diagram for QDP::BinaryBufferReaderWriter:
QDP::BinaryReaderWriter QDP::BinaryReader QDP::BinaryWriter

Public Member Functions

 BinaryBufferReaderWriter ()
 BinaryBufferReaderWriter (const std::string &s)
 Construct from a string.
 ~BinaryBufferReaderWriter ()
 Closes the buffer.
void open (const std::string &s)
 Construct from a string.
std::string str () const
 Return entire buffer as a string.
std::string strPrimaryNode () const
 Return entire buffer as a string.
void flush ()
 Flushes the buffer.
void clear ()
 Clear the buffer.
Public Member Functions inherited from QDP::BinaryReaderWriter
virtual ~BinaryReaderWriter ()
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.
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 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.
Public Member Functions inherited from QDP::BinaryWriter
 BinaryWriter ()
 Default constructor.
virtual ~BinaryWriter ()
virtual void writeArrayPrimaryNode (const char *output, size_t nbytes, size_t nmemb)
 Write data on the primary node only.
virtual void writeArray (const char *output, size_t nbytes, size_t nmemb)
 Write data from the primary node.
virtual void writeDesc (const std::string &output)
 Writes a fixed length of characters like an array.
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)
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.

Protected Member Functions

QDPUtil::n_uint32_tinternalChecksum ()
 Get the current checksum to modify.
std::istream & getIstream ()
 Get the internal input stream.
std::ostream & getOstream ()
 Get the internal output stream.
std::iostream & getIOstream ()
 Get the internal inpu/output stream.
Protected Member Functions inherited from QDP::BinaryReader
template<typename T>
void readPrimitive (T &output)
 The universal data-reader.
Protected Member Functions inherited from QDP::BinaryWriter
template<typename T>
void writePrimitive (const T &output)
 The universal data-writer.

Additional Inherited Members

Public Types inherited from QDP::BinaryReaderWriter
typedef std::iostream::pos_type pos_type
typedef std::iostream::off_type off_type
Public Types inherited from QDP::BinaryReader
typedef std::istream::pos_type pos_type
typedef std::istream::off_type off_type
Public Types inherited from QDP::BinaryWriter
typedef std::ostream::pos_type pos_type
typedef std::ostream::off_type off_type

Detailed Description

Binary buffer input/ouput class.

This class is used to read data from a binary buffer.

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

Definition at line 1569 of file qdp_io.h.

Constructor & Destructor Documentation

◆ BinaryBufferReaderWriter() [1/2]

QDP::BinaryBufferReaderWriter::BinaryBufferReaderWriter ( )

Definition at line 1540 of file qdp_io.cc.

◆ BinaryBufferReaderWriter() [2/2]

QDP::BinaryBufferReaderWriter::BinaryBufferReaderWriter ( const std::string & s)
explicit

Construct from a string.

Definition at line 1543 of file qdp_io.cc.

References open().

◆ ~BinaryBufferReaderWriter()

QDP::BinaryBufferReaderWriter::~BinaryBufferReaderWriter ( )

Closes the buffer.

Definition at line 1545 of file qdp_io.cc.

Member Function Documentation

◆ clear()

void QDP::BinaryBufferReaderWriter::clear ( )

Clear the buffer.

Definition at line 1577 of file qdp_io.cc.

References QDP::Layout::primaryNode().

◆ flush()

void QDP::BinaryBufferReaderWriter::flush ( )
inlinevirtual

Flushes the buffer.

Implements QDP::BinaryWriter.

Definition at line 1590 of file qdp_io.h.

◆ getIOstream()

std::iostream & QDP::BinaryBufferReaderWriter::getIOstream ( )
inlineprotectedvirtual

Get the internal inpu/output stream.

Implements QDP::BinaryReaderWriter.

Definition at line 1606 of file qdp_io.h.

◆ getIstream()

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

Get the internal input stream.

Implements QDP::BinaryReaderWriter.

Definition at line 1600 of file qdp_io.h.

◆ getOstream()

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

Get the internal output stream.

Implements QDP::BinaryReaderWriter.

Definition at line 1603 of file qdp_io.h.

◆ internalChecksum()

QDPUtil::n_uint32_t & QDP::BinaryBufferReaderWriter::internalChecksum ( )
inlineprotectedvirtual

Get the current checksum to modify.

Implements QDP::BinaryReaderWriter.

Definition at line 1597 of file qdp_io.h.

◆ open()

void QDP::BinaryBufferReaderWriter::open ( const std::string & s)

Construct from a string.

Definition at line 1547 of file qdp_io.cc.

References QDP::Layout::primaryNode().

Referenced by BinaryBufferReaderWriter().

◆ str()

std::string QDP::BinaryBufferReaderWriter::str ( ) const

Return entire buffer as a string.

Definition at line 1565 of file qdp_io.cc.

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

◆ strPrimaryNode()

std::string QDP::BinaryBufferReaderWriter::strPrimaryNode ( ) const

Return entire buffer as a string.

Definition at line 1554 of file qdp_io.cc.

References QDP::Layout::primaryNode().


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