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

Abstract specialization of MultiSyncFileWriter to write output to many files. Each writing operation will be written to one file or another depending on the WriteArgs. More...

#include <SimpleMultiSyncFileWriter.h>

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

Public Member Functions

 SimpleMultiSyncFileWriter (std::vector< std::string > const &path, std::ios_base::openmode om=std::ios_base::app)
 Simple synchronous multi-file writer constructor. More...
 
void finish () override
 SimpleMultiSyncFileWriter finish method assures that any output file stream that remains open is closed.
 
- Public Member Functions inherited from helios::filems::SyncFileWriter< WriteArgs ... >
 SyncFileWriter ()=default
 Default constructor for synchronous file writer.
 
std::string getPath ()
 Non index version of the SyncFileWriter::getPath(size_t const) function. More...
 

Protected Attributes

std::vector< std::ofstream > ofs
 Output file streams to be used by the simple multi synchronous file writer.
 
- Protected Attributes inherited from helios::filems::MultiSyncFileWriter< WriteArgs ... >
std::vector< std::string > path
 Paths to the files to be written.
 
std::vector< std::mutex > mutex
 One mutex per file to be written (i-th mutex corresponds to i-th file)
 
std::vector< std::shared_ptr< WriteStrategy< WriteArgs ... > > > writeStrategy
 The write strategies specifying how to write data, one per file.
 

Additional Inherited Members

- Protected Member Functions inherited from helios::filems::MultiSyncFileWriter< WriteArgs ... >
 MultiSyncFileWriter ()
 Default constructor for synchronous multi-file writer. More...
 
 MultiSyncFileWriter (std::vector< std::string > const &path)
 
void write (WriteArgs ... writeArgs) override
 Synchronously write to a single file. More...
 
virtual size_t indexFromWriteArgs (WriteArgs ... writeArgs)=0
 Any concrete implementation extending MultiSyncFileWriter must override this function to specify how to obtain the index from the WriteArgs. More...
 
std::string getPath (size_t const idx) const override
 Obtain the path to the idx-th file. More...
 

Detailed Description

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

Abstract specialization of MultiSyncFileWriter to write output to many files. Each writing operation will be written to one file or another depending on the WriteArgs.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
filems::MultiSyncFileWriter
filems::SyncFileWriter

Constructor & Destructor Documentation

◆ SimpleMultiSyncFileWriter()

template<typename ... WriteArgs>
helios::filems::SimpleMultiSyncFileWriter< WriteArgs >::SimpleMultiSyncFileWriter ( std::vector< std::string > const &  path,
std::ios_base::openmode  om = std::ios_base::app 
)
inlineexplicit

Simple synchronous multi-file writer constructor.

Parameters
pathPaths to the output files
omOpen mode for the files (append by default)

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