preCICE v3.1.2
|
File writer for table-data in text-format. More...
#include <TXTTableWriter.hpp>
Classes | |
struct | Data |
Represents one data entry to be written. More... | |
Public Types | |
enum | DataType { INT , DOUBLE , VECTOR2D , VECTOR3D } |
Constants defining possible data types to be written. More... | |
Public Member Functions | |
TXTTableWriter (const std::string &filename) | |
Constructor, opens file. | |
void | addData (const std::string &name, DataType type) |
Adds a data entry to the table. | |
void | writeData (const std::string &name, int value) |
Writes a integral scalar data value associated to the entry name. | |
void | writeData (const std::string &name, double value) |
Writes a floating-point scalar data value associated to the entry name. | |
void | writeData (const std::string &name, const Eigen::Vector2d &value) |
Writes a vector data value associated to the entry name. | |
void | writeData (const std::string &name, const Eigen::Vector3d &value) |
void | close () |
Closes the file, is automatically called on destruction. | |
void | reset () |
Resets the table information. | |
Private Attributes | |
logging::Logger | _log {"io::TXTTableWriter"} |
std::vector< Data > | _data |
std::vector< Data >::const_iterator | _writeIterator |
std::ofstream | _outputStream |
File writer for table-data in text-format.
Usage: Create the writer, add data entries in the wanted sequence, and write data values cyclically in the same sequence.
Definition at line 19 of file TXTTableWriter.hpp.
Constants defining possible data types to be written.
Enumerator | |
---|---|
INT | |
DOUBLE | |
VECTOR2D | |
VECTOR3D |
Definition at line 22 of file TXTTableWriter.hpp.
|
explicit |
Constructor, opens file.
Definition at line 10 of file TXTTableWriter.cpp.
void precice::io::TXTTableWriter::addData | ( | const std::string & | name, |
DataType | type ) |
Adds a data entry to the table.
Depending on the type and dimension, several text-columns might be added. The writeData() method has to be called in the order in which data entries are added.
Definition at line 24 of file TXTTableWriter.cpp.
void precice::io::TXTTableWriter::close | ( | ) |
Closes the file, is automatically called on destruction.
Definition at line 149 of file TXTTableWriter.cpp.
void precice::io::TXTTableWriter::reset | ( | ) |
Resets the table information.
Definition at line 156 of file TXTTableWriter.cpp.
void precice::io::TXTTableWriter::writeData | ( | const std::string & | name, |
const Eigen::Vector2d & | value ) |
Writes a vector data value associated to the entry name.
The write order is fixed by the order addData() is called.
Definition at line 100 of file TXTTableWriter.cpp.
void precice::io::TXTTableWriter::writeData | ( | const std::string & | name, |
const Eigen::Vector3d & | value ) |
void precice::io::TXTTableWriter::writeData | ( | const std::string & | name, |
double | value ) |
Writes a floating-point scalar data value associated to the entry name.
The write order is fixed by the order addData() is called.
Definition at line 79 of file TXTTableWriter.cpp.
void precice::io::TXTTableWriter::writeData | ( | const std::string & | name, |
int | value ) |
Writes a integral scalar data value associated to the entry name.
The write order is fixed by the order addData() is called.
Definition at line 58 of file TXTTableWriter.cpp.
|
private |
Definition at line 96 of file TXTTableWriter.hpp.
|
private |
Definition at line 94 of file TXTTableWriter.hpp.
|
private |
Definition at line 100 of file TXTTableWriter.hpp.
|
private |
Definition at line 98 of file TXTTableWriter.hpp.