📄 circularbuffer.h
字号:
// file: cb.h//// this file defines a circular buffer class//// make sure definitions are only made once//#ifndef __CB#define __CB// isip include files//#ifndef __ISIP_INTEGRAL#include <integral.h>#endifclass Circular_buffer { //--------------------------------------------------------------------------- // // protected data // //---------------------------------------------------------------------------protected: // data information // int* idx_d; int* num_d; int size_d; int dim_d; float_8** buf_d; //--------------------------------------------------------------------------- // // public methods // //---------------------------------------------------------------------------public: // constructors/destructors // Circular_buffer(); Circular_buffer(int dim, int num_elements); ~Circular_buffer(); // debug // void debug(); // allocation // void allocate_cc(int dim, int num_elements); // indexing methods // int add_cc(int dim, float_8 new_value); void write_cc(int dim, int index, float_8 value); void sub_cc(int dim) { if (--num_d[dim] < 0) num_d[dim] = 0; } void empty_cc(); // overloaded operators // float_8 operator() (int dim, int index); // get mothods // int get_size_cc(int dim) { return num_d[dim]; } //--------------------------------------------------------------------------- // // private methods // //---------------------------------------------------------------------------private: // none};//// end of include file#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -