Helios++
Helios software for LiDAR simulations
ZipVectorialSyncFileFullWaveformWriter.h
1 #pragma once
2 
3 #include <filems/write/comps/ZipSyncFileWriter.h>
4 #include <filems/write/strategies/ZipFullWaveformWriteStrategy.h>
5 #include <filems/write/strategies/VectorialWriteStrategy.h>
6 #include <scanner/detector/FullWaveform.h>
7 
8 #include <memory>
9 #include <vector>
10 
11 namespace helios { namespace filems{
12 
13 using std::make_shared;
14 using std::vector;
15 
28  public ZipSyncFileWriter<vector<FullWaveform> const &>
29 {
30 protected:
31  // *** ATTRIBUTES *** //
32  // ******************** //
40 
41 public:
42  // *** CONSTRUCTION / DESTRUCTION *** //
43  // ************************************ //
49  const string &path,
50  int compressionMode = boost::iostreams::zlib::best_compression
51  ) :
52  ZipSyncFileWriter<vector<FullWaveform> const&>(path, compressionMode),
53  zfwws(this->ofs, *(this->oa))
54  {
55  this->writeStrategy = make_shared<VectorialWriteStrategy<
57  >>(zfwws);
58  }
59  virtual ~ZipVectorialSyncFileFullWaveformWriter() = default;
60 };
61 
62 }}
Class representing a full waveform.
Definition: FullWaveform.h:12
std::ofstream ofs
Output file stream to be used by the simple synchronous file writer.
Definition: SimpleSyncFileWriter.h:31
std::string path
Path to file to be written.
Definition: SingleSyncFileWriter.h:28
std::shared_ptr< WriteStrategy< WriteArgs ... > > writeStrategy
The write strategy specifying how to write data to file.
Definition: SingleSyncFileWriter.h:36
Concrete class specializing WriteStrategy to make any other write strategy operate over a vector.
Definition: VectorialWriteStrategy.h:23
Like DirectFullWaveformWriteStrategy but zipping the output.
Definition: ZipFullWaveformWriteStrategy.h:15
Abstract child of SimpleSyncFileWriter which provides support for zipped output.
Definition: ZipSyncFileWriter.h:23
unique_ptr< boost::archive::binary_oarchive > oa
Binary output archive.
Definition: ZipSyncFileWriter.h:39
Concrete class specializing ZipSyncFileWriter to write a vector of full waveform to a zip file.
Definition: ZipVectorialSyncFileFullWaveformWriter.h:29
ZipVectorialSyncFileFullWaveformWriter(const string &path, int compressionMode=boost::iostreams::zlib::best_compression)
ZIP synchronous file full waveform vector writer constructor.
Definition: ZipVectorialSyncFileFullWaveformWriter.h:48
ZipFullWaveformWriteStrategy zfwws
The full waveform write strategy that is wrapped by the main write strategy in a vectorial fashion ( ...
Definition: ZipVectorialSyncFileFullWaveformWriter.h:39