Updated
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@879 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -1,22 +1,12 @@
|
||||
#include "TestBlock.hpp"
|
||||
|
||||
template<typename T>
|
||||
TestBlock<T>::TestBlock()
|
||||
void TestBlock::process(IBuffer &in, IBuffer &out)
|
||||
{
|
||||
auto buf_in = reinterpret_cast<Buffer<DTIN>&>(in);
|
||||
auto buf_out = reinterpret_cast<Buffer<DTOUT>&>(out);
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
TestBlock<T>::~TestBlock()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void TestBlock<T>::process(Buffer<T> &in, Buffer<T> &out)
|
||||
{
|
||||
size_t toCopy = in.len();
|
||||
out.write(in.data_r(), toCopy);
|
||||
in.consume(toCopy);
|
||||
size_t toCopy = buf_in.len();
|
||||
buf_out.write(buf_in.data_r(), toCopy);
|
||||
buf_in.consume(toCopy);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,19 +3,26 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ABlock.hpp>
|
||||
#include <Block.hpp>
|
||||
|
||||
template <typename T>
|
||||
class TestBlock : public ABlock<T>
|
||||
using DTIN = double;
|
||||
using DTOUT = double;
|
||||
|
||||
class TestBlock : public Block
|
||||
{
|
||||
public:
|
||||
TestBlock();
|
||||
~TestBlock();
|
||||
TestBlock(size_t bufSize)
|
||||
: Block(1, 1, DType::Double, DType::Double)
|
||||
, m_buf_in(bufSize)
|
||||
{
|
||||
|
||||
void process(Buffer<T> &in, Buffer<T> &out);
|
||||
}
|
||||
virtual ~TestBlock() = default;
|
||||
|
||||
void process(IBuffer &in, IBuffer &out) override;
|
||||
|
||||
private:
|
||||
|
||||
Buffer<DTIN> m_buf_in;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -8,10 +8,8 @@
|
||||
#define LENGTH(a) (sizeof(a)/sizeof(a[0]))
|
||||
#endif
|
||||
|
||||
int main()
|
||||
int test01()
|
||||
{
|
||||
printf("Hallo Welt!\n");
|
||||
|
||||
arma::mat myMat;
|
||||
// myMat.as_col();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user