summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/SmartWriter.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/includes/SmartWriter.h b/includes/SmartWriter.h
new file mode 100644
index 0000000..d8baf27
--- /dev/null
+++ b/includes/SmartWriter.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <Handle.h>
+
+class SmartWriterTask;
+
+namespace Balau {
+
+class SmartWriter : public Filter {
+ public:
+ SmartWriter(IO<Handle> h) : Filter(h) { AAssert(h->canWrite(), "SmartWriter can't write"); m_name.set("SmartWriter(%s)", h->getName()); }
+ virtual ssize_t write(const void * buf, size_t count) throw (GeneralException) override;
+ virtual const char * getName() override { return m_name.to_charp(); }
+ virtual void close() override;
+ private:
+ SmartWriterTask * m_writerTask = NULL;
+ String m_name;
+};
+
+}