Files
sdrpp/core/src/dsp/taps/tap.h
2024-07-26 23:55:26 +02:00

30 lines
643 B
C++

#pragma once
#include <volk/volk.h>
#include "../buffer/buffer.h"
namespace dsp {
template<class T>
class tap {
public:
T* taps = NULL;
unsigned int size = 0;
};
namespace taps {
template<class T>
inline tap<T> alloc(int count) {
tap<T> taps;
taps.size = count;
taps.taps = buffer::alloc<T>(count);
return taps;
}
template<class T>
inline void free(tap<T>& taps) {
if (!taps.taps) { return; }
buffer::free(taps.taps);
taps.taps = NULL;
taps.size = 0;
}
}
}