#ifndef NULLSOURCE_HPP #define NULLSOURCE_HPP #pragma once #include template class NullSource : public Block { public: NullSource(size_t bufSize) : Block(0, 1, DType::None, DType::Double) { } virtual ~NullSource() = default; void process() { Buffer *buf_out = dynamic_cast*>(m_buf_out); process(*buf_out); } void process(Buffer &out) { double d = 0; size_t toWrite = out.capacity() - out.len(); for (int i=0; i < toWrite; i++) { out.write(&d, 1); } } private: }; #endif // NULLSOURCE_HPP