#ifndef NULLSOURCE_HPP
#define NULLSOURCE_HPP

#pragma once

#include <Block.hpp>

template <typename T>
class NullSource : public Block
{
public:
	NullSource(size_t bufSize)
	: Block(0, 1)
	{

	}

	virtual ~NullSource() = default;

	void process()
	{
		Buffer<T> *buf_out = dynamic_cast<Buffer<T>*>(m_buf_out);
		process(*buf_out);
	}

	void process(Buffer<T> &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