adding iris benchmark
[c11concurrency-benchmarks.git] / iris / include / file_writer.h
diff --git a/iris/include/file_writer.h b/iris/include/file_writer.h
new file mode 100644 (file)
index 0000000..d59fe8e
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef IRIS_FILE_WRITER_H_
+#define IRIS_FILE_WRITER_H_
+
+
+#include <cstdio>
+#include <string>
+
+#include "stream_writer.h"
+
+namespace iris {
+
+// A log writer that appends logs to a file.
+class file_writer: public stream_writer {
+public:
+    file_writer(const char * filename);
+    ~file_writer();
+    virtual void write(const char * buffer, size_t len);
+private:
+    std::string m_filename;
+};
+
+}
+
+#endif
\ No newline at end of file