Peano
Loading...
Searching...
No Matches
tarch::reader::PeanoBinaryPatchFileReader Class Reference

Read a Peano patch file with binary quantities. More...

#include <PeanoBinaryPatchFileReader.h>

Inheritance diagram for tarch::reader::PeanoBinaryPatchFileReader:
Collaboration diagram for tarch::reader::PeanoBinaryPatchFileReader:

Protected Member Functions

void readValues (std::istream &in, int numberOfValues, std::vector< double > &values) const override
 Read the quantities of one patch.
 
Format getFormat () const override
 Format this reader supports.
 

Additional Inherited Members

- Public Types inherited from tarch::reader::PeanoTextPatchFileReader
enum class  Format { ASCII , Binary }
 
- Public Member Functions inherited from tarch::reader::PeanoTextPatchFileReader
virtual ~PeanoTextPatchFileReader ()=default
 
Content read (const std::string &fileName) const
 Read the whole file.
 
- Static Public Member Functions inherited from tarch::reader::PeanoTextPatchFileReader
static Header readHeader (const std::string &fileName)
 Read only the header of a file.
 

Detailed Description

Read a Peano patch file with binary quantities.

Counterpart of tarch::plotter::griddata::blockstructured::PeanoBinaryPatchFileWriter. All lines of the file are text as in a file with format ASCII. Only the line between begin cell-values and end cell-values is replaced by the raw doubles of the patch followed by one line break. The reader therefore knows how many bytes to read from the metadata and the dimensions, and the bytes may hold any value, including line breaks.

The doubles are stored in the byte order of the machine that wrote them. The reader assumes that it runs on a machine with the same byte order.

Definition at line 28 of file PeanoBinaryPatchFileReader.h.

Member Function Documentation

◆ getFormat()

Format tarch::reader::PeanoBinaryPatchFileReader::getFormat ( ) const
overrideprotectedvirtual

Format this reader supports.

Reimplemented from tarch::reader::PeanoTextPatchFileReader.

◆ readValues()

void tarch::reader::PeanoBinaryPatchFileReader::readValues ( std::istream &  in,
int  numberOfValues,
std::vector< double > &  values 
) const
overrideprotectedvirtual

Read the quantities of one patch.

The routine is called after the line begin cell-values has been read. It has to leave the stream such that the next line to be read is the line end cell-values.

Parameters
inStream of the file, opened in binary mode.
numberOfValuesNumber of doubles the patch holds. Derived from the cell metadata and the dimensions.
valuesOutput. Is cleared first.

Reimplemented from tarch::reader::PeanoTextPatchFileReader.


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