Helios++
Helios software for LiDAR simulations
SimpleSyncFileStringWriter.h
1 #pragma once
2 
3 #include <filems/write/comps/SimpleSyncFileWriter.h>
4 #include <filems/write/strategies/DirectStringWriteStrategy.h>
5 
6 #include <memory>
7 
8 namespace helios{ namespace filems{
9 
10 using std::make_shared;
11 
23  public SimpleSyncFileWriter<std::string const &>
24 {
25 public:
26  // *** CONSTRUCTION / DESTRUCTION *** //
27  // ************************************ //
33  const std::string &path,
34  std::ios_base::openmode om = std::ios_base::app
35  ) :
36  SimpleSyncFileWriter<std::string const &>(path, om)
37  {
38  this->writeStrategy = make_shared<DirectStringWriteStrategy>(
39  this->ofs
40  );
41  }
42  virtual ~SimpleSyncFileStringWriter() = default;
43 };
44 
45 }}
Concrete class specializing SimpleSyncFileWriter to write measurements directly to a file.
Definition: SimpleSyncFileStringWriter.h:24
SimpleSyncFileStringWriter(const std::string &path, std::ios_base::openmode om=std::ios_base::app)
Simple synchronous file string writer constructor.
Definition: SimpleSyncFileStringWriter.h:32
Abstract specialization of SingleSyncFileWriter to write output directly to a file.
Definition: SimpleSyncFileWriter.h:23
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