Helios++
Helios software for LiDAR simulations
helios::filems::MultiSyncFileWriter< WriteArgs > Class Template Referenceabstract

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

#include <MultiSyncFileWriter.h>

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

Protected Member Functions

 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...
 

Protected Attributes

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

- 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...
 

Detailed Description

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

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

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

Constructor & Destructor Documentation

◆ MultiSyncFileWriter()

template<typename ... WriteArgs>
helios::filems::MultiSyncFileWriter< WriteArgs >::MultiSyncFileWriter ( )
inlineprotected

Default constructor for synchronous multi-file writer.

Parameters
pathPaths to the files to be written
See also
MultiSyncFileWriter::path

Member Function Documentation

◆ getPath()

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

Obtain the path to the idx-th file.

Parameters
idxThe index of the file which path must be obtained
Returns
Path to the idx-th file

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

◆ indexFromWriteArgs()

template<typename ... WriteArgs>
virtual size_t helios::filems::MultiSyncFileWriter< WriteArgs >::indexFromWriteArgs ( WriteArgs ...  writeArgs)
protectedpure virtual

Any concrete implementation extending MultiSyncFileWriter must override this function to specify how to obtain the index from the WriteArgs.

Parameters
writeArgsThe arguments defining a write operation
Returns
The index corresponding to the requested write operation

◆ write()

template<typename ... WriteArgs>
void helios::filems::MultiSyncFileWriter< WriteArgs >::write ( WriteArgs ...  writeArgs)
inlineoverrideprotectedvirtual

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: