git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@884 b431acfa-c32f-4a4a-93f1-934dc6c82436
42 lines
502 B
C++
42 lines
502 B
C++
#ifndef NULLSINK_HPP
|
|
#define NULLSINK_HPP
|
|
|
|
#pragma once
|
|
|
|
#include <Block.hpp>
|
|
|
|
template <typename T>
|
|
class NullSink : public Block
|
|
{
|
|
public:
|
|
NullSink<T>(size_t bufSize)
|
|
: Block(1, 0, DType::Double, DType::None)
|
|
, m_buf_in(bufSize)
|
|
{
|
|
|
|
}
|
|
|
|
virtual ~NullSink() = default;
|
|
|
|
void process() override
|
|
{
|
|
process(m_buf_in);
|
|
}
|
|
|
|
void process(Buffer<T> &in)
|
|
{
|
|
in.print("NullSink: ");
|
|
in.consume(in.len());
|
|
}
|
|
|
|
IBuffer* buffer()
|
|
{
|
|
return &m_buf_in;
|
|
}
|
|
|
|
private:
|
|
Buffer<T> m_buf_in;
|
|
|
|
};
|
|
|
|
#endif |