Helios++
Helios software for LiDAR simulations
SimpleSyncFileWriter Class Reference

SyncFileWriter implementation for simple text format. More...

#include <SimpleSyncFileWriter.h>

Inheritance diagram for SimpleSyncFileWriter:
Collaboration diagram for SimpleSyncFileWriter:

Public Member Functions

 SimpleSyncFileWriter (const std::string &path, std::ios_base::openmode om=std::ios_base::app)
 Simple synchronous file writer constructor. More...
 
void _write (Measurement const &m, glm::dvec3 const &shift) override
 Write measurement to text file. More...
 
void _write (std::vector< double > const &fullwave, int fullwaveIndex, double minTime, double maxTime, glm::dvec3 const &beamOrigin, glm::dvec3 const &beamDir, long gpsTime) override
 Write fullwave to text file. More...
 
void _write (Trajectory const &t) override
 Write trajectory to compressed file. More...
 
void finish () override
 SimpleSyncFileWriter finish method does not do nothing. The writing operations are guaranteed to be done after the instance has been destroyed.
 
- Public Member Functions inherited from SyncFileWriter
 SyncFileWriter (const std::string &path)
 Instantiate a SyncFileWriter which writes to file at given path. More...
 
void write (Measurement const &m, glm::dvec3 const shift=glm::dvec3(0, 0, 0))
 Synchronously write Measurement to file. More...
 
void write (Trajectory const &t)
 Synchronously write trajectory to file. More...
 
void write (std::vector< double > const &fullwave, int fullwaveIndex, double minTime, double maxTime, glm::dvec3 const &beamOrigin, glm::dvec3 const &beamDir, long gpsTime)
 Synchronously write Fullwave to file. More...
 
std::string getPath ()
 Obtain the path to the file. More...
 

Protected Member Functions

virtual std::string measurementToString (Measurement const &m, glm::dvec3 const &shift)
 Build a string from measurement data. More...
 
virtual std::string trajectoryToString (Trajectory const &t)
 Build a string from trajectory data. More...
 
virtual std::string fullwaveToString (std::vector< double > const &fullwave, int fullwaveIndex, double minTime, double maxTime, glm::dvec3 const &beamOrigin, glm::dvec3 const &beamDir, long gpsTime)
 Build a string from fullwave data. More...
 

Protected Attributes

std::ofstream ofs
 Output file stream to be used by the simple synchronous file writer.
 

Detailed Description

SyncFileWriter implementation for simple text format.

Author
Alberto M. Esmoris Pena
Version
1.0

Constructor & Destructor Documentation

◆ SimpleSyncFileWriter()

SimpleSyncFileWriter::SimpleSyncFileWriter ( const std::string &  path,
std::ios_base::openmode  om = std::ios_base::app 
)
inlineexplicit

Simple synchronous file writer constructor.

Parameters
pathPath to the output file
omOpen mode for the file (append by default)

Member Function Documentation

◆ _write() [1/3]

void SimpleSyncFileWriter::_write ( Measurement const &  m,
glm::dvec3 const &  shift 
)
inlineoverridevirtual

Write measurement to text file.

See also
SyncFileWriter::_write(Measurement const &, glm::dvec3 const &)

Implements SyncFileWriter.

Reimplemented in ZipSyncFileWriter.

◆ _write() [2/3]

void SimpleSyncFileWriter::_write ( std::vector< double > const &  fullwave,
int  fullwaveIndex,
double  minTime,
double  maxTime,
glm::dvec3 const &  beamOrigin,
glm::dvec3 const &  beamDir,
long  gpsTime 
)
inlineoverridevirtual

Write fullwave to text file.

See also
SimpleSyncFileWriter::_write( std::vector<double> const &, int, double, double, glm::dvec3, glm::dvec3, long )

Implements SyncFileWriter.

Reimplemented in ZipSyncFileWriter.

◆ _write() [3/3]

void SimpleSyncFileWriter::_write ( Trajectory const &  t)
inlineoverridevirtual

Write trajectory to compressed file.

See also
SimpleSyncFileWriter::_write( long, double, double, double, double, double, double )

Implements SyncFileWriter.

Reimplemented in ZipSyncFileWriter.

◆ fullwaveToString()

virtual std::string SimpleSyncFileWriter::fullwaveToString ( std::vector< double > const &  fullwave,
int  fullwaveIndex,
double  minTime,
double  maxTime,
glm::dvec3 const &  beamOrigin,
glm::dvec3 const &  beamDir,
long  gpsTime 
)
inlineprotectedvirtual

Build a string from fullwave data.

Returns
String with fullwave data

◆ measurementToString()

virtual std::string SimpleSyncFileWriter::measurementToString ( Measurement const &  m,
glm::dvec3 const &  shift 
)
inlineprotectedvirtual

Build a string from measurement data.

Parameters
mMeasurement data itself
shiftShift for the measurement coordinates
Returns
String with measurement data

◆ trajectoryToString()

virtual std::string SimpleSyncFileWriter::trajectoryToString ( Trajectory const &  t)
inlineprotectedvirtual

Build a string from trajectory data.

Returns
String with trajectory data

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