#ifndef NULLSOURCE_HPP #define NULLSOURCE_HPP #pragma once #include class NullSource : public Block { public: NullSource(DType dtype) : Block(0, 1, DType::None, dtype) { } virtual ~NullSource() = default; void process(IBuffer &out) override { if (dtype_out() == DType::Double) { auto buf_out = reinterpret_cast&>(out); process_double(buf_out); } } void process_double(Buffer &out) { double d = 0; for (int i=0; i < (out.capacity() - out.len()); i++) { out.write(&d, 1); } } private: }; #endif // NULLSOURCE_HPP