Files
cpp/radio/processor/test/NullSource.hpp
T
jens 49dbb70de7 - removed type stuff
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@885 b431acfa-c32f-4a4a-93f1-934dc6c82436
2022-05-29 08:44:22 +00:00

40 lines
538 B
C++

#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