Helios++
Helios software for LiDAR simulations
helios::filems::SingleSyncFileWriter< WriteArgs > Class Template Reference

Abstract class defining common behavior for all synchronous writers that work with a single file at a time. More...

#include <SingleSyncFileWriter.h>

Inheritance diagram for helios::filems::SingleSyncFileWriter< WriteArgs >:
Collaboration diagram for helios::filems::SingleSyncFileWriter< WriteArgs >:

Public Member Functions

 SingleSyncFileWriter ()
 Default constructor for synchronous single-file writer.
 
 SingleSyncFileWriter (const std::string &path)
 Instantiate a SingleSyncFileWriter which writes to file at given path. More...
 
void write (WriteArgs ... writeArgs) override
 Synchronously write to a single file. More...
 
std::string getPath (size_t const idx) const override
 Obtain the path to the file. More...
 
- Public Member Functions inherited from helios::filems::SyncFileWriter< WriteArgs ... >
 SyncFileWriter ()=default
 Default constructor for synchronous file writer.
 
virtual void finish ()
 Finish the writing so all writing operations are performed and all buffers are closed.
 
std::string getPath ()
 Non index version of the SyncFileWriter::getPath(size_t const) function. More...
 

Protected Attributes

std::string path
 Path to file to be written.
 
std::mutex mutex
 Mutex to synchronize concurrent write operations.
 
std::shared_ptr< WriteStrategy< WriteArgs ... > > writeStrategy = nullptr
 The write strategy specifying how to write data to file.
 

Detailed Description

template<typename ... WriteArgs>
class helios::filems::SingleSyncFileWriter< WriteArgs >

Abstract class defining common behavior for all synchronous writers that work with a single file at a time.

Author
Alberto M. Esmoris PEna
Version
1.0
See also
filems::WriteStrategy
filems::SyncFileWriter

Constructor & Destructor Documentation

◆ SingleSyncFileWriter()

template<typename ... WriteArgs>
helios::filems::SingleSyncFileWriter< WriteArgs >::SingleSyncFileWriter ( const std::string &  path)
inlineexplicit

Instantiate a SingleSyncFileWriter which writes to file at given path.

Parameters
pathPath to file to be written
See also
SingleSyncFileWriter::path

Member Function Documentation

◆ getPath()

template<typename ... WriteArgs>
std::string helios::filems::SingleSyncFileWriter< WriteArgs >::getPath ( size_t const  idx) const
inlineoverridevirtual

Obtain the path to the file.

Returns
Path to the file

Implements helios::filems::SyncFileWriter< WriteArgs ... >.

◆ write()

template<typename ... WriteArgs>
void helios::filems::SingleSyncFileWriter< WriteArgs >::write ( WriteArgs ...  writeArgs)
inlineoverridevirtual

Synchronously write to a single file.

See also
SyncFileWriter::write

Implements helios::filems::SyncFileWriter< WriteArgs ... >.


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