Helios++
Helios software for LiDAR simulations
SyncFileWriter.h
1 #pragma once
2 
4 
5 #include <string>
6 #include <sstream>
7 
8 namespace helios { namespace filems{
9 
17 template <typename ... WriteArgs>
19 public:
20  // *** CONSTRUCTION / DESTRUCTION *** //
21  // ************************************ //
25  SyncFileWriter() = default;
26  virtual ~SyncFileWriter(){}
27 
28  // *** W R I T E *** //
29  // ******************* //
33  virtual void write(WriteArgs ... writeArgs) = 0;
34 
35  // *** F I N I S H *** //
36  // ********************* //
41  virtual void finish() {}
42 
43  // *** GETTERS and SETTERS *** //
44  // ***************************** //
51  virtual std::string getPath(size_t const idx) const = 0;
57  inline std::string getPath(){return getPath(0);}
58 };
59 
60 }}
Abstract class defining common behavior for all synchronous file writers.
Definition: SyncFileWriter.h:18
virtual std::string getPath(size_t const idx) const =0
Obtain the path to the file corresponding to the idx-th writing stream.
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.
Definition: SyncFileWriter.h:41
virtual void write(WriteArgs ... writeArgs)=0
Handle synchronous write operations.
std::string getPath()
Non index version of the SyncFileWriter::getPath(size_t const) function.
Definition: SyncFileWriter.h:57