3 #include <filems/write/comps/SyncFileWriter.h>
4 #include <filems/write/strategies/WriteStrategy.h>
9 namespace helios {
namespace filems{
20 template <
typename ... WriteArgs>
65 void write(WriteArgs ... writeArgs)
override {
67 std::lock_guard<std::mutex> lock(
mutex);
73 catch(std::exception &e){
75 ss <<
"SingleSyncFileWriter failed to write. EXCEPTION: \n\t"
77 logging::WARN(ss.str());
87 std::string
getPath(
size_t const idx)
const override {
return path;}
Abstract class defining common behavior for all synchronous writers that work with a single file at a...
Definition: SingleSyncFileWriter.h:21
std::mutex mutex
Mutex to synchronize concurrent write operations.
Definition: SingleSyncFileWriter.h:32
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
void write(WriteArgs ... writeArgs) override
Synchronously write to a single file.
Definition: SingleSyncFileWriter.h:65
SingleSyncFileWriter()
Default constructor for synchronous single-file writer.
Definition: SingleSyncFileWriter.h:45
std::string getPath(size_t const idx) const override
Obtain the path to the file.
Definition: SingleSyncFileWriter.h:87
SingleSyncFileWriter(const std::string &path)
Instantiate a SingleSyncFileWriter which writes to file at given path.
Definition: SingleSyncFileWriter.h:53
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