1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// CircularBuffer.h
#include <stdint.h>

#ifndef _CIRCULARBUFFER_h
#define _CIRCULARBUFFER_h

/**
 * \brief Delay buffer class
 * 
 * This class allows to create arbitrary delay
 * Memory is dynamically allocated by Constructor 
 */
class CircularBuffer {

private:
	float* buffer;
	int _size;
public:
	CircularBuffer(int32_t size);
	~CircularBuffer();
	void PushData(float data);
	float GetData(int32_t delay);
};


#endif


//                  #     # ### 
//                  ##    #  #  
//                  # #   #  #  
//                  #  #  #  #  
//                  #   # #  #  
//                  #    ##  #  
//                  #     # ### 
//
// Nuclear Instruments 2020 - All rights reserved
// Any commercial use of this code is forbidden
// Contact info@nuclearinstruments.eu