3 namespace helios {
namespace filems{
14 template <
typename ... WriteArgs>
23 std::vector<std::ofstream>
ofs;
34 std::vector<std::string>
const&
path,
35 std::ios_base::openmode om = std::ios_base::app
41 size_t const numFiles =
path.size();
42 for(
size_t i = 0 ; i < numFiles ; ++i){
44 std::ofstream &ofsi =
ofs[i];
45 ofsi.open(
path[i], om);
47 std::ios_base::eofbit |
48 std::ios_base::failbit |
62 for(std::ofstream &
ofs :
ofs){
63 if(
ofs.is_open())
ofs.close();
Abstract class defining common behavior for all synchronous writers that work with multiple files at ...
Definition: MultiSyncFileWriter.h:21
std::vector< std::string > path
Paths to the files to be written.
Definition: MultiSyncFileWriter.h:28
Abstract specialization of MultiSyncFileWriter to write output to many files. Each writing operation ...
Definition: SimpleMultiSyncFileWriter.h:15
SimpleMultiSyncFileWriter(std::vector< std::string > const &path, std::ios_base::openmode om=std::ios_base::app)
Simple synchronous multi-file writer constructor.
Definition: SimpleMultiSyncFileWriter.h:33
void finish() override
SimpleMultiSyncFileWriter finish method assures that any output file stream that remains open is clos...
Definition: SimpleMultiSyncFileWriter.h:61
std::vector< std::ofstream > ofs
Output file streams to be used by the simple multi synchronous file writer.
Definition: SimpleMultiSyncFileWriter.h:23