summaryrefslogtreecommitdiff
path: root/includes/SmartWriter.h
blob: b237f297cb9cfc63e02a570d330af21d96485041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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() throw (GeneralException) override;
  private:
    SmartWriterTask * m_writerTask = NULL;
    String m_name;
};

}