25#include "ring_buffer.hh"
33 typedef tuple<long int, array<double, n>> ElementType;
35 Buffer(
int size) : ring_buffer(size) {
37 for (
int i=0; i<n; i++ ) {
43 Buffer(
int size, std::array<string,3> input_names) : ring_buffer(size) {
45 for (
int i=0; i<n; i++ ) {
56 std::get<0>(data) = count++;
57 for (
int i=0; i<n; i++ ) {
58 std::get<1>(data)[i] = inputs[i];
60 ring_buffer.write(&data, 1);
63 int get_buffered_output(ElementType * result,
int max) {
64 return ring_buffer.read(result, max);
70 unsigned long int count;
71 RingBuffer<ElementType> ring_buffer;
void update()
Definition buffer.hh:55
void init()
Definition buffer.hh:51
An abstract base class for modules.
Definition module.hh:39
int add_input(string name)
Definition module.cc:33
Definition additive_saw.cc:24