3 #include <filems/write/comps/SyncFileWriter.h>
4 #include <filems/write/strategies/WriteStrategy.h>
9 namespace helios {
namespace filems{
20 template <
typename ... WriteArgs>
28 std::vector<std::string>
path;
60 void write(WriteArgs ... writeArgs)
override {
65 std::lock_guard<std::mutex> lock(
mutex[idx]);
71 catch(std::exception &e){
73 ss <<
"MultiSyncFileWriter failed to write. EXCEPTION: \n\t"
75 logging::WARN(ss.str());
94 std::string
getPath(
size_t const idx)
const override {
return path[idx];}
Abstract class defining common behavior for all synchronous writers that work with multiple files at ...
Definition: MultiSyncFileWriter.h:21
MultiSyncFileWriter()
Default constructor for synchronous multi-file writer.
Definition: MultiSyncFileWriter.h:46
std::vector< std::mutex > mutex
One mutex per file to be written (i-th mutex corresponds to i-th file)
Definition: MultiSyncFileWriter.h:33
std::vector< std::string > path
Paths to the files to be written.
Definition: MultiSyncFileWriter.h:28
virtual size_t indexFromWriteArgs(WriteArgs ... writeArgs)=0
Any concrete implementation extending MultiSyncFileWriter must override this function to specify how ...
std::string getPath(size_t const idx) const override
Obtain the path to the idx-th file.
Definition: MultiSyncFileWriter.h:94
void write(WriteArgs ... writeArgs) override
Synchronously write to a single file.
Definition: MultiSyncFileWriter.h:60
std::vector< std::shared_ptr< WriteStrategy< WriteArgs ... > > > writeStrategy
The write strategies specifying how to write data, one per file.
Definition: MultiSyncFileWriter.h:37
Abstract class defining common behavior for all synchronous file writers.
Definition: SyncFileWriter.h:18
Interface that must be implemented by any class which supports write implementations for file writers...
Definition: WriteStrategy.h:14